Posts

Showing posts from March, 2022

Adding a red asterisk to required fields using label in LWC

Image
I am trying to add a double or single asterisk to lightning: input tags in LWC, by using "required" tag inside the tag I am able to see the asterisk, but two issues with this are I have to show a red asterisk to some conditionally mandatory issues. Solution -  You can use  label-hidden  variant and put a label. <template> <label>Middle Name</label> <abbr title="required" class="slds-required">**</abbr> <lightning-input label="Middle Name" variant="label-hidden" aria-required="true" maxlength="80"></lightning-input> </template>

How to Deploy Platform Event from Sandbox to Production ?

Custom platform events are sObjects, similar to custom objects. Define a platform event in the same way you define a custom object. Please visit this link - https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_define.htm

Run One Apex Batch for two object but remember always prefer to write batch per object.

  Hi Friends, I have shared one of the concepts in which we have used one apex batch for two objects. but remember it depends based on the condition. And according to my opinion, always write apex batch class per/each objects. global class Batchsampledeleterecord implements Database.Batchable<string>, Database.Stateful, Schedulable {     global boolean bReRun = false; //will be used to determine if batch has to re-run in case there are more that 10K of records     global Iterable<String> start(Database.BatchableContext bc) {         return new list<String> { 'custom_object__c', 'custom_object2__c'}; //list of strings with my object names     }     global void execute(Database.BatchableContext bc, list<string> lstsObjectName){         list<sObject> lstDeleteRecords = new list<sObject>();         for(string strObjectName : lstsObjectName) {   ...