Questions tagged [context]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

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 ...
zaitsman's user avatar
  • 1,890
0 votes
1 answer

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 ...
Maya Tran's user avatar
  • 229
0 votes
1 answer

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@...
Isuru Buddhika Herath's user avatar
0 votes
2 answers

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; @...
Kamil Motyka's user avatar
1 vote
1 answer

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: ...
manymanymore's user avatar
3 votes
1 answer

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 (...
nicolevy's user avatar
  • 394
0 votes
2 answers

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 (...
Prasadium's user avatar
0 votes
1 answer

What is the execution context for an asynchronous method?

Is it always system context, or it depends on where the method is called?
Renato Oliveira's user avatar
3 votes
1 answer

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 ...
highfive's user avatar
  • 6,231
7 votes
2 answers

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)...
Colin Steel's user avatar
2 votes
0 answers

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 ...
Curious Bee's user avatar
4 votes
1 answer

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....
Matt and Neil's user avatar
6 votes
2 answers

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?
Matt and Neil's user avatar
0 votes
1 answer

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 ...
Michael Balint's user avatar
8 votes
1 answer

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 ...
Uwe Heim's user avatar
  • 28.3k