Copy a value based on criteria Salesforce
On a Salesforce.com opportunity I have a number of custom fields that are potential options that the end client will eventually select.
Option 1 (Desc Field) Option 1 (Value) Option 2 (开发者_开发百科Desc Field) Option 2 (Value) Option 3 (Desc Field) Option 3 (Value)
At a future point the user will ultimately choose one of the options as the preferred option. What I want is then the value for the chosen option to be stored in another field without the user having to enter it again. A “nice to have” would also be that all 3 option descriptions, values and selected value are locked once this is done.
Any ideas?
Two things come to mind:
(1) The second field could be a formula field that derives it's answer based on the first field.
(2) A workflow rule using a field update to set the value of the second field, using a formula
(3) A trigger to do the same as #2.
As far as locking, one semi-popular method to lock a page layout is to essentially have two page layouts. The first layout has the fields normally, the second layout has the fields with "read-only". You then create a record type called "Read Only", for example. After the user has entered some specific information in a specific set of fields, a trigger could then check the record type from the normal default one, to the "Read Only" one. To the user's point of view, the record will be the same, but now he sees it from a different page layout.
精彩评论