Questions tagged [context]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
9
votes
1answer
3k views

Get a FIRST-CLASS SessionID for API Calls (looking for a clean way or alternative)

I am basically facing the same challenge as @Evan here Different Session Ids in Different contexts I'm also running into SessionID related issues, but in a completely different use case. Background ...
6
votes
2answers
267 views

System.runAs not reflected in trigger context

I have a test class, with this code System.debug(UserInfo.getProfileId()); Profile p = [SELECT Id FROM Profile WHERE Name = 'Standard User']; User u = new User(ProfileId = p.Id, ...); System.runAs(u)...
5
votes
2answers
515 views

How can my code tell if it's inside a Queueable context?

To go with the new System.Queueable interface, I'm looking for the analogy of: System.isBatch() System.isFuture() System.isScheduled() Is there a System.isQueued() or something?
4
votes
1answer
1k views

Testing the ACTUAL batchable context in Database.Batchable methods?

I'm trying to mock Database.BatchableContext to make my unit tests more robust and to eliminate excess usage of Test.isRunningTest() running in production code. Few hacks are available like Json....
3
votes
1answer
733 views

Schema.SObjectType.myObj.getRecordTypeInfosByName() runs in User Context?

The documentation for Schema.SObjectType.myObj.getRecordTypeInfosByName() says The current user is not required to have access to a record type to see it in this map So I was in the intention ...
2
votes
1answer
311 views

Is it possible to pass the id of the current record when calling apex from process builder?

I have a process that acts on Contact creation and waits for an hour, then needs to check to see if a related object was created. Since I haven't found any way to check for that related object (...
2
votes
1answer
286 views

Find user agent string in lightning controller

In Visualforce controllers, we have ApexPages.currentPage().getHeaders() to get info like user-agent, etc... Is there any equivalent for Lightning controllers? I know this info can be found from $...
1
vote
1answer
47 views

Are Business Manager user and Job contexts mean the same in SFCC?

Are Business Manager and Job contexts mean the same in SFCC? I would like to perform OCAPI requests during a job execution. So, I am exploring the OCAPI setup. Here is the documentation excerpt: ...
1
vote
0answers
116 views

Executing a block of code in apex class with context/visibility of a specific user

I need to execute a block of code in apex class with context/visibility of a specific user. This user is mentioned in a custom field of a custom object. The need is similar to System.Runas() method ...
0
votes
1answer
88 views

What is the execution context for an asynchronous method?

Is it always system context, or it depends on where the method is called?
0
votes
0answers
16 views

SFDX Scratch Org is not getting Created with IoT enabled

my project-scratch-def.json is { "orgName": "LTD", "edition": "Developer", "adminEmail":"***********@gmail.com", "hasSampleData":false, "features": ["IoT"], "settings": { "...
0
votes
2answers
29 views

How to open a particular record in salesforce from another web app

I am looking to open a particular object's record in salesforce after clicking a link in some another web app. With the link click I need to pass some set of attributes to Salesforce webservice (...
0
votes
1answer
1k views

Unable to retrieve context in canvas app when authenticating with oauth

I’m having trouble authenticating my canvas app using oauth2. This is despite being able to authenticate and connect via other means. The following is my problem in detail… I’ve configured a ...
-1
votes
1answer
29 views

How can I determine the calling source of a trigger?

I have a managed package with different triggers. Is there a way to get the calling source that invoked the trigger action? For example: if other package initiated the action, get its namespace, and ...