Hot answers tagged


Spring '16 brings us a new method: System.isQueueable() which takes care of this requirement. As of Spring '16, isBatch() does NOT return true from inside Queueable implementation.


You can pass a list of ID's from process builder to the @InvocableMethod in Apex that represents the Contacts. In Process Builder, you would set the Field that represents in method parameter to reference the Contact Id value. Apex class public class ContactInvokable { @InvocableMethod public static void ProcessContacts(List<Id> contactIds) ...


I have set up an MVR in my org (cs19). I ran the below code using API Version 37.0 and 39.0, both of which passed. So this behavior is not generally reproducible. You might share your API Version and instance name as well. Test Class @IsTest class DemoTests { static testMethod void testRunAsProfile() { final String PROFILE_NAME = 'Some ...


This code compiles indicating Database.BatchableContext is an interface: public class MockBatchableContext implements Database.BatchableContext { private Id jobId; private Id childJobId; public MockBatchableContext(Id jobId, Id childJobId) { this.jobId = jobId; this.childJobId = childJobId; } public Id getJobId() { ...


Record Type Names work the same way as a Field or Object's Label. Since the Record Type Name is subject to translation, it can differ depending on the user's locale settings. Because of this, Schema.SObjectType.myObj.getRecordTypeInfosByName() will return different Record Type Names depending on the running user's locale. Currently the only way to ...


Following @eric's recommendation, I was able to use login() which indeed seems to return a full powered first-class sessionId - at least for my requirement I finally got the logs! Instead of using the WSDL I found a much simpler way to use the AJAX Toolkit just with sforce.connection.login(username,passwordAndToken); In the end it will do the same callout ...


You want to use reactive variables: @wire(getPicklistValues, { recordTypeId:'$recordTypeId', fieldApiName: { fieldApiName: '$fieldName', objectApiName: '$objectName' } }) PicklistValues; You can read more in Understand the Wire Service.


It doesn't matter where it's called from, but it does matter if you specify "with sharing." If you specify "with sharing," then sharing is enforced. If you do not specify a sharing mode, or you specify "without sharing," it runs in system context.


Business Manager User context means that in the session there is a Business Manager User logged in. You can perform OCAPI requests from a job, but they would be executed in their own context. You would have one thread of the application server that handles the job, and another thread that handles the OCAPI requests. These two will have separate contexts. ...

Only top voted, non community-wiki answers of a minimum length are eligible