Skip to main content

Posts

Showing posts from December, 2019

Lead Conversion and validation rules

Lead Conversion and validation rules  Enable 'Require Validation for Converted Leads' in Salesforce Classic Go to  Setup | Build | Customize | Leads | Lead Settings. Click on  Edit . Select  Require Validation for Converted Leads . Click on  Save . Enable 'Require Validation for Converted Leads' in Lightning Experience Click on gear icon then  Setup . On the Home Tab, look for  Feature Settings  |  Marketing  |  Lead Settings . Click on  Edit . Select  Require Validation for Converted Leads . Click on  Save . https://help.salesforce.com/articleView?id=000334707&type=1&mode=1 https://help.salesforce.com/articleView?id=000331020&language=en_US&type=1&mode=1 https://success.salesforce.com/answers?id=9063A000000E3d6

SOQL Useful snippets

https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_agg_functions.htm Select distinct Records, example products with duplicate Product codes SELECT ProductCode, COUNT(Id) FROM Product2 GROUP BY ProductCode HAVING COUNT(Id) > 1

Useful APEX Code Snippets

***** Field Validations and ERROR message public PageReference save() { PageReference result=null; Contact cont=(Contact) stdCtrl.getRecord(); if ( (String.IsBlank(cont.Email)) && (String.IsBlank(cont.Phone)) ) { cont.email.addError ('Please enter an email address or phone number'); cont.phone.addError ('Please enter a phone number or email address'); } else { result=stdCtrl.save(); } return result; }