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
Akshay JuwaAkshay Juwa 

Lock the 'Distribution Date' field so that if cant be changed and set the date based on when the 'code used' checkbox is checked?

Hello everybody, I'm trying to figure out how to lock the date field when the code used checkbox is checked and set the date based on the code used is checked. Initially I was going to approach using a flow, but team prefered to use a formula instead. I'd really appreaciate the help.
Best Answer chosen by Akshay Juwa
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Akshay,

Thanks for confirming.  We cannot use ISCHANGED() or PRIORVALUE() in case of Formula field . So we may not be able to achieve this using formula field. As you said we may have to go with flow only.

If this solution helps, please mark it as best answer.

Thanks,

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Akshay,

Can you confirm what type of field Distribution Date is . If that is Date field then your approach of using flow is correct. Because it is normal Date field you cannot use the formule for it. Are they asking you to use Default Value to populate the date?

Thanks,
 
Akshay JuwaAkshay Juwa
Hey Sai,

The Distribution Date is a date formula field. They haven't speified on using the default value to populate the date but if thats a possibility I'd be more than happy to use it.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Akshay,

Thanks for confirming.  We cannot use ISCHANGED() or PRIORVALUE() in case of Formula field . So we may not be able to achieve this using formula field. As you said we may have to go with flow only.

If this solution helps, please mark it as best answer.

Thanks,
This was selected as the best answer