Salesforce Lightning Web Component datatable Validation
oncellchange event can be used for cell or column level changes validation. onsave event can be used used for validating all the values that are updated. Sample Code: Apex Class: ....
oncellchange event can be used for cell or column level changes validation. onsave event can be used used for validating all the values that are updated. Sample Code: Apex Class: ....
Database.queryWithBinds() in Salesforce Apex allows us to dynamically pass bind variables values to a Salesforce SOQL Query string. Map < String, Object > datatype reduces the number of parameters declaration ....
SOQL with ALL ROWS can be used in Apex to find number of Deleted Salesforce Pending Service Routing Records. System.debug( 'No of deleted PSRs is ' + [ SELECT COUNT() ....
To find Object Key Prefix using Name in Salesforce Apex, we can use getKeyPrefix() method from DescribeSObjectResult class. Sample Code: DescribeSObjectResult sobjectRes = PendingServiceRouting.sObjectType.getDescribe(); System.debug( 'Key prefix is ' + ....
EncodingUtil.base64Decode() can be used to convert Base64 String to Blob value. Then, the blob value can be used in the Messaging.EmailFileAttachment to attach attachment to the Email. Sample Code: List ....
Test.load() can be used to load Data from Static Resource in Salesforce Test Class. The Static Resource should contain a csv file. 1. Create a csv file with sample data. ....
isExternalID() from the Schema.DescribeFieldResult can be used to find External Id fields in an Salesforce Object. Sample Apex Code: DescribeSObjectResult sObjectRes = Account.sObjectType.getDescribe(); Map < String , Schema.SObjectField > mapFieldList ....
Option 1: System.debug( 'Create Allowed? ' + Schema.sObjectType.Account.isCreateable() ); System.debug( 'Update Allowed? ' + Schema.sObjectType.Account.isUpdateable() ); System.debug( 'Delete Allowed? ' + Schema.sObjectType.Account.isDeletable() ); Option 2: DescribeSObjectResult sobjectRes = Account.sObjectType.getDescribe(); System.debug( ....
EventBus.EventPublishSuccessCallback and EventBus.EventPublishFailureCallback interfaces can be used in an Apex Class to track Successful and Failure Salesforce Platform Events. Sample Apex Class: public class PlatformEventHandler implements EventBus.EventPublishSuccessCallback, EventBus.EventPublishFailureCallback { public ....
Exception: System.InvalidParameterValueException: Invalid private key. Must be 16 bytes. Resolution: When we use Crypto.encryptWithManagedIV(), the key should be at least 16 bytes. Sample Code: /* Encryption */ Blob key = ....