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
LisaSturzLisaSturz 

Default Value based on field on page

Is there a way to set the default value of a field based on the value of another field on the page layout? We would like to default a date field to 1/1/ of the current year only if the Network field is set to "ACN". Thank you!

Pavan789456Pavan789456

write a work flow rule with a field update.

 

Thanks

sandeep@Salesforcesandeep@Salesforce

You can achieve it by writing a trigger ( before update and before insert) OR by work flow field update ( but mind that after executing a field update your trigger [ if you have on that object with update event ] will be re-executed )

gautam_singhgautam_singh

Hi,



Workflow will be best solution here . But the drawback is it will update the record after the record is being Saved that is after you click the SAVE button.


I will suggest to go with Formula Field also as that will be displayed over the Detail Page and not on Edit Page but will reflect only after SAVE button is clicked !

The Hit to Bull's Eye would be hard , Visualforce Page , once you create a page and value comes in Network field , it will on spot be relflected in the Date Field as per your choice. But it is a bad way to go for as for mere a small function you will need to create a Page. If you have tough functionalities to be done over this Object in future then I would suggest to go with this else not.




Important :

Hit Kudos [Star Icon ] if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You
-