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
SnehalCSnehalC 

Auto changing field value based on another field

Hi,

I have a custom status picklist field, the value of which changes at every approval step. This is achived through field update for all the 5 approval steps. I have one more picklist field for which I want it's value to be changed automatically whenever status field value changes. I am thinking of workflow rules but I will have to create so many (at least 7). Is there any better solution? or workflow rule is best option?
Best Answer chosen by SnehalC
SamReadySamReady
If the second picklist value is automatically set, is it a safe assumption to assume that you will not want the end user to manually set it themselves? In this case I would recommend a formula field of type text that is defined off of the value of the picklist updated by the approval steps.

In the step where you enter the formula for your formula field, the content would look like this (with all conditions and with your actual picklist field value:
CASE(1,
               IF(ISPICKVAL(myPicklist__c, "ApprovalStep1"), 1, 0), "value for step 1",
               IF(ISPICKVAL(myPicklist__c, "ApprovalStep2"), 1, 0), "value for step 2",
               ...
            "value for default result")

the "value for [x]" string would be the resulting values for the text field that you are setting in lieu of a picklist.

All Answers

SamReadySamReady
If the second picklist value is automatically set, is it a safe assumption to assume that you will not want the end user to manually set it themselves? In this case I would recommend a formula field of type text that is defined off of the value of the picklist updated by the approval steps.

In the step where you enter the formula for your formula field, the content would look like this (with all conditions and with your actual picklist field value:
CASE(1,
               IF(ISPICKVAL(myPicklist__c, "ApprovalStep1"), 1, 0), "value for step 1",
               IF(ISPICKVAL(myPicklist__c, "ApprovalStep2"), 1, 0), "value for step 2",
               ...
            "value for default result")

the "value for [x]" string would be the resulting values for the text field that you are setting in lieu of a picklist.
This was selected as the best answer
Chris Weihe 2Chris Weihe 2
Sam, could you halep with a similar situation...  When a user selects types in a value between ranges such as 10--40% a value of (TODAY)+60 is placed in the result field, if user types in a value of selects types in a value between ranges such as 41-60% a value of (TODAY)+45 is placed in the result field, if a user types 61-100 percent a value of (TODAY)+30 is placed in the result field.  Thnak in advance!!!  PS Thanks for your work with both Udacity & Trailhead!