Questions tagged [context]
The context tag has no usage guidance.
15
questions
1
vote
1
answer
5k
views
Run Apex in the context of a different user
Is it possible to run Apex in the context of a different user?
Specifically, we are building a custom Partner Community. We want to share some information about some custom objects but we want to ...
0
votes
1
answer
680
views
User/Profile access to Organization fields (IsSandbox) in Flow
I have a Flow that checks the Organization field "isSandbox" to determine whether or not to email a test address or a real address. However, when logged in as a non-admin user, this field is ...
0
votes
1
answer
977
views
Error: MIXED_DML_OPERATION Very Confused
I'm very confused about MIXED_DML_OPERATIONerror. Following test case fails in production but passes in uat.
@IsTest
private class MyControllerTest {
private static final String USERNAME ='test@...
0
votes
2
answers
667
views
LWC @wire change 'this' context
I have a problem with my code
export default class PdmNewModalPlist extends LightningElement {
@api objectName;
@api fieldName;
@api apiName;
@api recordTypeId;
@track obj;
@...
1
vote
1
answer
287
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:
...
3
votes
1
answer
8k
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 (...
0
votes
2
answers
323
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
1
answer
1k
views
What is the execution context for an asynchronous method?
Is it always system context, or it depends on where the method is called?
3
votes
1
answer
3k
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 ...
7
votes
2
answers
601
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)...
2
votes
0
answers
560
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 ...
4
votes
1
answer
2k
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....
6
votes
2
answers
2k
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?
0
votes
1
answer
2k
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 ...
8
votes
1
answer
4k
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 ...