Queueable classes are great to use and provides a wide range of advantages when compared to future methods. But there are some undocumented limitations which you will come across if you are using Queueable classes extensively inside your batch classes. Lets take an example of badly written trigger on Account. trigger AccountTrigger on Account (before insert) { for(Account acc: Trigger.new){ Database.executeBatch(new CreateContactBatch(), 2); } } The above trigger calls a batch class for every account record that gets inserted in database. So if you insert N accounts in a single transaction via dataloader or anonymous block or through any other means, the trigger will execute the batch class N number of times. Below is the code for batch class: global class CreateContactBatch implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.Bat...
Today we will have a look at how to create a lightning component for countdown timer which can be used on pages where an operation needs to be completed within a specific time period. Example, an online exam or a banking transaction which expires after a specific time period. The component contains a datetime field which represents the end time. Once the user selects the date and time and clicks on Start Timer button, the countdown timer will start. Below is the lightning component: CountdownTimer.cmp <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global" > <aura:attribute name="endTime" type="String"/> <aura:attribute name="timeLeft" type="String"/> <lightning:tile label="Time Left" class="slds-page-header"> {!v.timeLeft} </lightning:tile...
Dependent picklist are not supported by default in the lightning components. There is no component provided by Salesforce through which we can have dependent picklist in custom lightning components. Fot this example, I have created two custom fields of type picklist - Country and State on Account. After creating the fields, I have setup dependency between them where Country is the controlling picklist and State is the dependent picklist. Below are the components used: Picklist.cmp - Generic component to display picklist in lightning component. Just pass in the object api name and field api name to display the picklist. StateCountryPicklist.cmp - This component displays the state values as the per controlling country value passed to it. Below is the code for all the components: StateCountryPicklist.cmp <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId" access="global...
I Ravi,May I have the apex controller PicklistController.apxc
ReplyDelete