function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Saurabh Bisht 19Saurabh Bisht 19 

Using Trigger Design Pattern and Trigger on Account.

-Firstly make two custom field on Account Object.
--Salutation(Type Picklist) Values:Dr , Proff ,Trainee
--Name(Type Text)
--------------------------------------------------------------
What we have to do that whenever user create new record and 
filled Name field then after created record then we will see
Salutation field will filled automatically with Dr. and Before 
Insert and Before Update trigger will be pass in trigger parameter.
----------------------------------------------------------------
AnkaiahAnkaiah (Salesforce Developers) 
Hi Saurabh,

Whatever the name created an account,  you need to auto populate salutation as Dr. Am i correct?

thanks!!
Saurabh Bisht 19Saurabh Bisht 19
yes you are correct supoose
Dr. mANISH Accountname will whatever you wish do it with trigger design bulkyinhg trigger
AnkaiahAnkaiah (Salesforce Developers) 
Try with below code.

Create two fields on account object.

Name__c ==> Data type ==> text
Salutation__c ==> Data type==> Picklist

try with below code.
trigger Salutationupdate on Account (before insert) {

    if(trigger.isbefore && trigger.isinsert){
        for(Account acc:trigger.new){
            if(acc.Name__c!=null){
			
			acc.Salutation__c = 'Dr';
              
            }
            
        }   
    }
 }

If this helps, Please mark it as best answer.

Thanks!!​​​​​​​