Questions tagged [context]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
56 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 ...
user avatar
  • 1,598
0 votes
1 answer
335 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 ...
user avatar
  • 219
0 votes
1 answer
415 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@...
user avatar
0 votes
2 answers
418 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; @...
user avatar
0 votes
0 answers
767 views

Flow can't access a CustomNotificationType when called from a Process

I have created a Custom Notification Type called SMS Received. I am calling it from a Flow, where I have insert the correct Id for it and provided all the params. When invoked from the Debugger, it ...
user avatar
1 vote
1 answer
192 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: ...
user avatar
3 votes
1 answer
7k 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 (...
user avatar
  • 384
0 votes
2 answers
76 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 (...
user avatar
0 votes
1 answer
566 views

What is the execution context for an asynchronous method?

Is it always system context, or it depends on where the method is called?
user avatar
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 ...
user avatar
  • 6,161
7 votes
2 answers
508 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)...
user avatar
2 votes
0 answers
377 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 ...
user avatar
4 votes
1 answer
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....
user avatar
6 votes
2 answers
1k 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?
user avatar
0 votes
1 answer
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 ...
user avatar
9 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 ...
user avatar
  • 33.6k