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

different default values

Hello everybody,


  I wanted to know if i could set different default values for a text field on different page layouts?


 Also, how do I default "closed" value for Case status on Close Case detail page when I click "Close Case" button on Case Page?


Thanks in Advance.



Text field default values can only be set using information that is available before a record is created, including information about the user / profile, etc. You can't do this based on any other attribute of the object or record since it hasn't been created yet. Your only option would be some sort of custom Visualforce page that is called when the New button is pressed that just does some analysis and then sets the field on the standard page layout using URL parameters.


For the Close Case page, you can't set it using standard configuration. You would have to create a new custom button and put it on the Case page layouts (remove the original Close button). You can use URL parameters - (not supported by Salesforce) to pass the Close Status. It would be something like this: /{!Case.Id}/s?retURL=%2F{!Case.Id}&cas7=Closed


The cas7 field is the Status field on the Close Case page layout.