function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
asgirisoftasgirisoft 

UserInfo.getSessionId() returns null on a time-based workflow trigger

Hello,

 

I have a future callout from a time-based trigger. This callout in turn calls a Visualforce page.

On the trigger, UserInfo.getSessionId() returns null, hence the page does not get invoked; the Http callout hits the Salesforce.com login page. Please suggest a way to obtain the sessionid on a Apex trigger invoked by a Time based workflow?

 

What is the validity time for a SFDC sessionid?

 

Andi Giri

Softsquare

www.softsquare.biz

Federico LarsenFederico Larsen

Hi Andi,

 

I have the same problem.

Did you find a way to get sessionid?

 

Best regards

 

Thanks in advance for any help provided.

muralikrishna.sfdcmuralikrishna.sfdc

for async process sectionid whould be null.

 

see this link at sessionId sessionid

 

Returns the session ID for the current session.

For Apexcode that is executed asynchronously, such as@futuremethods, Batch Apex jobs, or scheduled Apexjobs,getSessionIdreturnsnull.

As a best practice, ensure that your code handles both cases – when a session ID is or is not available.