Skip to main content

Hi,

 

1. I do have a Custom field as STATUS with picklist values as CLOSED and DUPLICATE.  

 

2. Do also have Custom field as CLOSED BY (protected mode)

 

Requirement needed is as : When the user selects the STATUS as CLOSED or DUPLICATE (any other value the CLOSED BY field should not be filled) the CLOSED BY field should be filled by the user name who is changing the status to CLOSED or DUPLICATE.

 

Please suggest with the CODE. Your help is really appriciated.

 

Thanks

 

Ravi
4 answers
  1. Nov 15, 2017, 5:08 PM
    Hi Ravi,

     

    You could do this with a Workflow/Proces Builder with a field update/record update action

     

    Make the field Read only

     

    Create a Workflow on the Object

     

    Evaluation Criteria: Created and everytime its edited (2nd Option)

     

    Rule Criteria: formula evaluates to True

     

    formula is

    AND(

    ISCHANGED(Status__c),

    CASE(Status__c,

    'CLOSED',1,

    'DUPLICATE',1,

    0)=1

    )

    Immediate Action Feild Update

     

    Field to Update: Closed By

     

    use formula to set the new value and the formula is

    $User.FirstName + " " + $User.LastName

    Save,Done and Activate the workflow rule

0/9000