Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Hot answers tagged

9

Spring '16 brings us a new method: System.isQueueable() which takes care of this requirement. releasenotes.salesforce.com/en-us/spring16/release-notes/rn_apex_new_classes_methods.htm As of Spring '16, isBatch() does NOT return true from inside Queueable implementation.


4

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) ...


4

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 ...


4

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() { ...


3

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 ...


3

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 ...


2

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.


1

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