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
Evan MillaisEvan Millais 

Ensure select group of fields are filled out when a lead progresses status

What is the standard formula for ensuring a group of fields are filled out when a lead status is moved on, thanks
AnkaiahAnkaiah (Salesforce Developers) 
Hi Evan,

Can you explain more details about your requirement?
 
Evan MillaisEvan Millais

Sure. so we have x5 Lead Status' and each Lead Status has a Lead Detail Field.

I want to make sure that if the staff member moves the stage on they have filled out all the fields at the previous stage.

For example, our first Lead Status field is 'Lead Information'

Lead Information has these fields associated with it:

Agreed Actions, Agreed Action Next Date, Name, Phone, Mobile, Email, Is the Client Vulnerable

If the user moves it to the next stage which is 'Goals and Aspirations' I want the system to check that the fields above contain a value, and if they don't - the system tells the user they need to fill them out.

Hope that helps

AnkaiahAnkaiah (Salesforce Developers) 
Lead status field have "Lead Information" & "Goals and Aspirations" pickist values and user try to change the lead status from "Lead Information" to "Goals and Aspirations" pickist value then system should check the all the above fields are filled or not. I am i correct?

If my understanding is correct then use the below formula and write a validation rule on Lead object.

Please modify the field api names as per your system.
 
AND(ISCHANGED(ISPICKVAL(Status, 'Goals and Aspirations'),
     OR( ISBLANK(Next_Date__c),
		 Agreed_Actions__c=false,
		 ISBLANK(Name),
		 ISBLANK(Phone),
		 ISBLANK(Mobile),
		 ISBLANK(Email),
		 Is_the_Client_Vulnerable__c =false
	 )))

Note: If Is_the_Client_Vulnerable__c/Agreed_Actions__c fields are not check boxes then replace them with ISBLANK(Is_the_Client_Vulnerable__c)/ISBLANK(Agreed_Actions__c )

If this helps, please mark it as best answer.

Thanks,
Ankaiah