Callable Interface in Salesforce
The System.Callable interface enables you to use a common interface to build loosely coupled integrations between Apex classes or triggers, even for code in separate packages. Agreeing upon a common ....
The System.Callable interface enables you to use a common interface to build loosely coupled integrations between Apex classes or triggers, even for code in separate packages. Agreeing upon a common ....
Use System.Url.getOrgDomainUrl() to get the Salesforce domain URL using Apex . Use getOrgDomainUrl() in orgs with or without My Domain to retrieve canonical URLs. For example: https://yourDomain.my.salesforce.com, or, for orgs ....
value attribute on the lightning:inputField tag can be used to set field values on lightning:recordEditForm. Check the following sample code for reference. Sample Code: Sample.cmp: <aura:component implements="force:appHostable" > <aura:attribute name="AccountId" ....
onrowselection can be used to handle selectedRows in lightning:dataTable.The keyField should be mapped to a unique identifier attribute from the payload. Sample Code: Component: <aura:component implements="force:appHostable" controller="AccountListController"> <aura:attribute type="Account[]" name="acctList"/> ....
Sample Code: Component: <aura:component implements="force:appHostable" controller="AccountListController"> <aura:attribute type="Account[]" name="acctList"/> <aura:attribute name="mycolumns" type="List"/> <aura:handler name="init" value="{!this}" action="{!c.init}"/> <div style="height: 300px"> <lightning:datatable data="{! v.acctList }" columns="{! v.mycolumns }" keyField="Id" hideCheckboxColumn="false" enableInfiniteLoading="true" onloadmore="{! ....
Sample Code: Component: <aura:component implements="force:appHostable" controller="AccountListController"> <aura:attribute type="Account[]" name="acctList"/> <aura:attribute name="mycolumns" type="List"/> <aura:handler name="init" value="{!this}" action="{!c.fetchAccounts}"/> <lightning:datatable data="{! v.acctList }" columns="{! v.mycolumns }" keyField="Id" hideCheckboxColumn="true"/> </aura:component> Component Controller: ({ fetchAccounts ....
Sample REST Class: @RestResource(urlMapping='/Account/*') global with sharing class SampleRest { @HttpGet global static Account doGet() { RestRequest req = RestContext.request; String acctId = req.requestURI.substring(req.requestURI.lastIndexOf('/') + 1); Account result = [SELECT ....
disabled attribute on the button type in the lightning:datatable can be used to Disable and Enable button. Sample Code: Apex Classes: Wrapper Class: public class AccountWrapper { @AuraEnabled public String ....
now() The now() mehtod in Salesforce Apex returns the current Datetime based on a GMT calendar. So, system.now() and Datetime.now() returns Datetime based on a GMT calendar. now().format() The now().format() ....
Simplify Your Code with the Apex Switch Statement Apex now provides a switch statement that tests whether an expression matches one of several values and branches accordingly.Apex switch statement expressions can ....