Recall Approval Process using Apex in Salesforce
Sample Code: ProcessInstanceWorkitem[] workItems = [ SELECT Id FROM ProcessInstanceWorkitem WHERE ProcessInstance.TargetObjectId = '0016A00000OXbfi' ....
Sample Code: ProcessInstanceWorkitem[] workItems = [ SELECT Id FROM ProcessInstanceWorkitem WHERE ProcessInstance.TargetObjectId = '0016A00000OXbfi' ....
Sample Code:AccountList.cmp: <aura:component implements="force:appHostable" controller="AccountListController"> <aura:attribute type="Account[]" name="acctList"/> <aura:attribute name="gridColumns" type="List" /> <aura:attribute name="gridData" type="Object" /> ....
Error Handling in Lightning Component's JavaScript Controller is important. The try statement in JavaScript helps us to test a block of code for errors. The catch statement in JavaScript helps us ....
Sample Code for String between double quotes: String str = 'a"abc"'; System.debug( 'String between quotes is ' + str.subStringBetween( '"', '"' ) ); Output: Sample Code for String between white ....
Apex class: public class USStateCodeController { @AuraEnabled public static List < US_State_Codes__mdt > fetchUSStateCodes() { return [ SELECT Label, State_Code__c FROM US_State_Codes__mdt ORDER BY Label ]; } } USStateCode.cmp: <aura:component ....
Sample Code: Component: <aura:component implements="force:appHostable" controller="OpportunitySearchController"> <aura:attribute name="oppty" type="Opportunity" default="{ 'sobjectType': 'Opportunity'}"/> <aura:attribute name="columns" type="List"/> <aura:attribute name="opportunityList" type="Opportunity[]"/> <aura:attribute name="PaginationList" type="Opportunity[]"/> <aura:attribute name="startPage" type="Integer" /> <aura:attribute name="endPage" type="Integer"/> <aura:attribute name="totalRecords" ....
AccountList.cmp <aura:component controller="AccountListController" implements="flexipage:availableForAllPageTypes,lightning:actionOverride,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:appHostable" > <aura:attribute type="Account[]" name="acctList"/> <aura:attribute name="mycolumns" type="List"/> <aura:attribute name="sortedBy" type="String" ....
AccountList.cmp: <aura:component controller="AccountListController" implements="flexipage:availableForAllPageTypes,lightning:actionOverride,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:appHostable" > <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> AccountListController.js ({ fetchAccounts : function(component, ....
force:navigateToURL can be used for Navigation in Salesforce Lightning. AccountList.cmp: <aura:component controller="AccountListController" implements="flexipage:availableForAllPageTypes,lightning:actionOverride,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:appHostable" > <aura:attribute type="Account[]" name="acctList"/> <aura:handler name="init" value="{!this}" action="{!c.fetchAccounts}"/> <table class="slds-table slds-table_bordered slds-table_cell-buffer"> <thead> <tr class="slds-text-title_caps"> <th scope="col"> ....
Sample App: <aura:application extends="force:slds"> <c:AccountList /> </aura:application> Lightning Aura Component: AccountList.cmp: <aura:component controller="AccountListController"> <aura:attribute type="Account[]" name="acctList"/> <aura:handler name="init" value="{!this}" action="{!c.fetchAccounts}"/> <table class="slds-table slds-table_bordered slds-table_cell-buffer"> <thead> <tr class="slds-text-title_caps"> <th scope="col"> <div ....