Create User in Apex Test Class
INTERNAL USER EXTERNAL USER OR COMMUNITY USER
INTERNAL USER EXTERNAL USER OR COMMUNITY USER
In Salesforce, you can set the “From” address in a SingleEmailMessage by using the setOrgWideEmailAddressId method. Here’s an example of how you can set the “From” address: Make sure to replace [OrgWideEmailAddressId] with the actual Organization-Wide Email Address ID that you want to use as the “From” address. The Organization-Wide Email Address must be previously …
Setting From Address in Single Email Message in Salesforce Read More »
Custom Settings and Custom Metadata are two types of custom configuration data in Salesforce. Here are the main differences between them: Overall, the choice between Custom Settings and Custom Metadata depends on the specific use case and requirements of the application. Custom Settings are more suitable for dynamic configuration data that may need to be …
Difference between Custom Setting and Custom Metadata Read More »
To retrieve records in Salesforce using a curl request in Apex, you would need to make use of Salesforce’s REST API. Assuming you are well aware of HTTP requests, REST Api and cURL; Here’s an example of how you can construct a curl request in Apex to retrieve records: In this example, we are constructing …
Using cURL in apex to retrieve the records in Salesforce Read More »
INTRODUCTION The objects ‘SandboxInfo’ and ‘SandboxProcess,’ are available in API v35 or higher, and allow you to create and refresh sandboxes. Tolloing api can be used to create or refresh the sandbox. SandboxInfoRepresents a sandbox. SandboxInfo enqueues a sandbox for creation or for being refreshed. To learn more please review the Force.com Tooling API SandboxInfo section. SandboxProcessRepresents …
How can we refresh or create Sandbox using API in Salesforce Read More »
Introduction This error is thrown while sending email using apex if you are setting User Id in target recipient: setTargetObjectId(usr.Id) and also specifying target record id as: setWhatId(opp.Id). As per Salesforce documentation if you are passing record id in WhatId then you can only pass Contact Id in setTargetObjectId. Here is Salesforce article: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_single.htm Workaround
In case if you are looking to disable standard duplicate rule while creating record from apex – especially in case of integration and backend processes – we can use DMLOptions.DuplicateRuleHeader as below.
From the Documentation: Recalculates all formula fields on an sObject, and sets updated field values. Rather than inserting or updating objects each time you want to test changes to your formula logic, call this method and inspect your new field values. Then make further logic changes as needed. See https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm Note that this method doesn’t recalculate …
Recalculate Formula Fields Dynamically (without save) Read More »
Is it possible to assign permission setting using code? Are there any limitations to consider? YES, it’s possible as below:
In case if you are looking further, how to assign such permission sets to users automatically, here is answer: http://sfdcian.com/assigning-permission-set-to-user-in-apex/