You need to sign in to do that
Don't have an account?

Userinfo.getSessionId() Not Valid On Lightning Context.
Hi Everyone,
I have created an automated process through process builder and process builder calling Apex Class
See below Apex class which is called from process builder ----- code sample
global without sharing class ICM_ProcessInvocableClass{
@InvocableMethod(label='ICMServiceClass' description='')
global static void callICMServiceBus(List<String> RecordIdList) {
string sessionToken = UserInfo.getSessionId();
system.debug('@@@@sessionToken:-- '+sessionToken);
system.debug('@@@@UserTheme:-- '+userinfo.getUiThemeDisplayed());
ICM_ServiceBusAPICallClass.CallICMServiceAPI(eachRecId,sessionToken);
}
}
To pass session id to CallICMServiceAPI method (@feature Method),
The above class called from process builder when our opportunity record is created or edited.
if i edited opportunity record in lightning context our session id is invalid.
please give me solution in this.
I have created an automated process through process builder and process builder calling Apex Class
See below Apex class which is called from process builder ----- code sample
global without sharing class ICM_ProcessInvocableClass{
@InvocableMethod(label='ICMServiceClass' description='')
global static void callICMServiceBus(List<String> RecordIdList) {
string sessionToken = UserInfo.getSessionId();
system.debug('@@@@sessionToken:-- '+sessionToken);
system.debug('@@@@UserTheme:-- '+userinfo.getUiThemeDisplayed());
ICM_ServiceBusAPICallClass.CallICMServiceAPI(eachRecId,sessionToken);
}
}
To pass session id to CallICMServiceAPI method (@feature Method),
The above class called from process builder when our opportunity record is created or edited.
if i edited opportunity record in lightning context our session id is invalid.
please give me solution in this.
Please refer to the following Known issue thread (https://success.salesforce.com/issues_view?id=a1p3A000000EAUPQA4) that talk about it. Hope it helps.
Please mark the thread as SOLVED and answer as the BEST ANSWER if it helps address your issue.
From Winter 18 when u debug session id u will not be able to see but u will get the id in the variable and can be used as per requirement.
Thanks
Saket Sharma