Test class for SObject in Salesforce
Sample Apex Class: public class Sample { public static void insertRecord( SObject objRecord ) { try { insert objRecord; ....
Sample Apex Class: public class Sample { public static void insertRecord( SObject objRecord ) { try { insert objRecord; ....
Sample Code: Apex Class: public with sharing class ExistingFilesController { @AuraEnabled( cacheable = true ) public static List < ContentDocument > fetchContentDocuments( String strRecordId ) { List ....
instanceof can be used to find the object type in Salesforce Apex. TYPEOF can be used to find the object type in Salesforce SOQL. For Task Object with What field: ....
1. Lightning Web Component is HTML: <template> Selected industries are <template for:each={Industries} for:item="ind"> <p key={ind}>{ind}</p> </template> </template> JavaScript: import { LightningElement, api } from 'lwc'; export default class TestFlowComponent extends ....
Apex Class: public with sharing class PublicGroupOrQueueAssignmentController { @AuraEnabled( cacheable=false ) public static UserWrapper fetchGroupAssignments( String strGroupId ) { UserWrapper objUW = new UserWrapper(); Set < String > setAssignedUserIds = ....
Sample code: Apex Class: public class QueueAssignmentController { @AuraEnabled( cacheable=true ) public static QueueWrapper fetchQueueAssignments() { QueueWrapper objQW = new QueueWrapper(); Set < String ....
Note: I have used Google reCAPTCHA v2 Checkbox in the below implementation. 1. Navigate https://www.google.com/recaptcha. 2. Click on the "V3 Admin console" button. 3. Click the ‘+’ create icon. 4. ....
Sample Code: @RestResource(urlMapping='/AccountRESTAPI/*') global class AccountRESTAPIController { @HttpGet global static Account fetchAccount() { Account objAccount = new Account(); RestRequest req = RestContext.request; String accNum = req.params.get( 'accNum' ); return [ ....
Sample CSV File: Sample code: Apex: public with sharing class FileUploadController { @AuraEnabled public static String loadData( Id contentDocumentId ) { String ....
Sample code: DescribeSObjectResult objDescribe = SObjectType.Employee__c; system.debug( 'Label is ' + objDescribe.getLabel() ); Output: