0

I'm having the following issue, would highly appreciate any help regarding it:

On the Case object I have field__1 (of type picklist). This field is mandatory upon case closure but can be populated before to. It's populated sometimes by the user and at other times automatically. In certain cases I want to update this field based on another field (field__2 - type picklist), by using a workflow. The scenario is: When a case is closed and the field__1 is not empty Check field__2: If field__2 = A or B -> set field__1 to be X If field__2 = C -> set field__1 to be Y If field__2 = D -> set field__1 to be Z

The formula is in the WF, the value (X, Y, Z) to update field__1 is decided in the WF - but how can I transfer this value to the field update action? Is it possible to pass it as a variable somehow? Because the field is picklist I don't have the option "Use a formula to set the new value" - but this is what I need...

1

I think this is not possible by Workflow rule. Here salesforce is trying to prevent you from entering any invalid values (values not list as picklist values) from standard point and click mechanism. However in apex code you can achieve this. In order to have your code configuration (means your condition which are based on some value in some field) you can go with below solution.

  1. Create a formula which will have value which needs to be updated in field__1. By creating formula you will have ability to modify at any time without touching apex.
  2. Update the picklist field with the value of formula field in insert and update trigger.

This way you need to code, but atleast you will have configurations in terms of formula.

  • Sounds good, Kiran, thanks! Now I just need to learn how to work with Apex... – Rachel S. Nov 22 '15 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.