Posts

Email Merge Fields missing - resoling

1. Check field-level permissions. 2. if you are sending from apex check, in soql those fields are mentioned. 3. check the template name if you are cloning some templates. 4. check HTML code in template if any conditional display.

get Salesforce base url using apex

  URL.getSalesforceBaseUrl().toExternalForm();

How to delete .invalid In user Email (For selected emails only Or for all users) for newly created sandbox or refreshed sandbox

1. Create this class -------------------------------------------------------------------- public class EmailUtils {     public Static String removeInvalidDomain(String email) {         if (email != null && email.contains('@')) {             String[] parts = email.split('@');             String username = parts[0];             String domain = parts[1].toLowerCase();                          if (domain.endsWith('.invalid')) {                 domain = domain.substring(0, domain.length() - 8);             }                          return username + '@' + domain;         }                  return email; ...

Apex Schedules ,Scheduled Jobs Cron Expressions

Cron Expressions for Subscription Schedules  https://help.salesforce.com/s/articleView?id=sf.reports_subscription_reporting_cron.htm&type=5 Run Scheduled Apex job only once https://help.salesforce.com/s/articleView?id=000382128&type=1

Apex best Practices in salesforce

* if we need to create multiple test records in test class we can create list and then do single insert operation because database operation or dml operation are slow when compared to apex operations. * No soql inside forloop * In ofter trigger we con't directly use trigger context variables(listofnewrexords) we need to soql if we need to change same records. * 

How to get Current recordId to flow from quickaction in salesforce

Image
 Resolution :  1.create new resource as text type variable. 2. Remember Variable API name should be as "recordId". 3.We don't need to assign value to this variable, it will automatically fetch from current page. 4. refer where ever we need current recordpage  recorded in flow as we use general flow variable.

Vs code Command Pallet

Ctrl + Shift + P --- to launch command pallet in vscode 1. SFDX: Turn On Apex Debug Log for Replay Debugger // to enable our break points or log in our org // enable debug features in vscode. 2. SFDX: Get Apex Debug Logs // this is for getting apex logfiles in to vscode