Posts

How to get sessionid and salesforce org base url in salesforce

 old : string getSessionId=UserInfo.getOrganizationId().substring(0, 15) + ' ' +  UserInfo.getSessionId().substring(15); string loginUrl=URL.getSalesforceBaseUrl().toExternalForm()+'/secur/frontdoor.jsp?sid='+getSessionId; System.debug('>>>>>>>DEBUG>>>>>>>>>>>'+loginUrl); =========================================== new 12-6-2024 1. string getSessionId=UserInfo.getOrganizationId().substring(0, 15) + ' ' +  UserInfo.getSessionId().substring(15); string loginUrl='/secur/frontdoor.jsp?sid='+getSessionId; System.debug('>>>>>>>DEBUG>>>>>>>>>>>'+loginUrl); 2. ofter domain we need to add step1 output then we get full url for login using sessionid in salesforce. =========================================================== 1 : domain: 2 : add url : / secur/frontdoor.jsp?sid= 3: org id: 00D6u0000004Y50 4. session: 5. sessio id means : org ...

How to handle recursive trigger in apex salesforce

 https://help.salesforce.com/s/articleView?id=000386331&type=1

How to check empty sring in salesforce flow

  {!$GlobalConstant.EmptyString} Note : this will work for Text type of datatype in flow.

How to assecc varible in flow - Salesforce

for suppose u are created varible in flow like "GetEmailRecord"  then as below u need to assign that variable to other varible or object field {!GetEmailRecord}

How to get old record in flow salesforce or how to refer old record

 How to get old record in flow salesforce or how to refer old record {!$Record__Prior.Status} current record {!$Record.Status}

How to add current datetime to datetime field in flow Salesforce

when there is a date time field in object and if we need to add current date time to that field based on some condition in flow salesforce we will use this variable.    {!$Flow.CurrentDate} {!$Flow.CurrentDateTime}

Assign a claim to queue using apex code in salesforce and (Test class) code

 Assign a claim to queue using apex code in salesforce  and (Test class) code How to Assign a record to queue in salesforce using apex code List<QueueSobject> newClaimQueueList = [SELECT CreatedById,Id,QueueId,Queue.Name,SobjectType,SystemModstamp FROM QueueSobject where SobjectType = 'Acc_Claims__c']; List<String> stringset=new List<String>(); Group g=[SELECT Id FROM Group WHERE Type = 'Queue' and Name IN :stringset limit 1]; claim__c.OwnerId=g.id; insert claim__c test class : Group testGroup1 = new Group(Name='Claims  team', Type='Queue');         insert testGroup1; System . runAs ( new User(Id=UserInfo.getUserId()) )  { QueueSObject q1 = new QueueSObject(QueueID = testGroup1.id, SobjectType = 'claim__c');  insert q1; }