You need to sign in to do that
Don't have an account?
Claire Nicolay
Formula field for status based on 3 criteria
Can somebody help with a formula field called "status" as follows
if field "requested" is ticked, then "status" equals "ongoing"
if field "date approved" contains a date, then "status" equals "approved"
if field "date rejected" contains a date, then the "status" equals "rejected"
many thanks!
if field "requested" is ticked, then "status" equals "ongoing"
if field "date approved" contains a date, then "status" equals "approved"
if field "date rejected" contains a date, then the "status" equals "rejected"
many thanks!
The suggestion from Ram and Akhil will both work and solve your problem; however, it with generate a syntax error for a missing parenthesis.
The modfied version which would work is as follows: Now based on the limited information, I am guessing what you are trying to achieve here is to set the Status value on a record as Approved or Rejected or In-Review using three different fields. I am also guessing that you are using the OOTB Approval Process engine to manage the approval processes in SFDC. Based on these two assumptions, I am curious as to what is your rationale behind this solution design?
Another approach would have been to do the following:
- Create a picklist field named Status with 4 values namely Draft, In-Review, Approved and Rejected. You may also add a fifth value as Recalled.
- Set the default value for Status field to Draft.
- Create a Date field named "Approval/Rejection Date".
- Use the Approval process to control the value of the Status field.
- As part of the initial Submission actions, set the value of the Status field as "In-Review".
- As part of the Final Approval/Rejection action, set the value of the Status field as "Approved" or "Rejected".
- As part of the Final Approval/Rejection action, set the value of the "Approval/Rejection Date" as TODAY.
- In case you do want to allow requests to be Recalled then set the value of the Status field as "Recalled" in the Recall actions.
This would be a better and more efficient approach to handle the kind of functionality you are building.Please excuse my interjection as I know you had simply asked for the correct syntax but looking at the names of the fields you were planning to use, I could not help but ask about the reasoning behind your approach.
Kind Regards,
Swarna.
All Answers
IF(NOT(ISBLANK(date approved field)), value_if_true, value_if_false )
IF(NOT(ISBLANK(date rejected field)), value_if_true, value_if_false )
You can use a formula like this
Hope that helps !
The suggestion from Ram and Akhil will both work and solve your problem; however, it with generate a syntax error for a missing parenthesis.
The modfied version which would work is as follows: Now based on the limited information, I am guessing what you are trying to achieve here is to set the Status value on a record as Approved or Rejected or In-Review using three different fields. I am also guessing that you are using the OOTB Approval Process engine to manage the approval processes in SFDC. Based on these two assumptions, I am curious as to what is your rationale behind this solution design?
Another approach would have been to do the following:
- Create a picklist field named Status with 4 values namely Draft, In-Review, Approved and Rejected. You may also add a fifth value as Recalled.
- Set the default value for Status field to Draft.
- Create a Date field named "Approval/Rejection Date".
- Use the Approval process to control the value of the Status field.
- As part of the initial Submission actions, set the value of the Status field as "In-Review".
- As part of the Final Approval/Rejection action, set the value of the Status field as "Approved" or "Rejected".
- As part of the Final Approval/Rejection action, set the value of the "Approval/Rejection Date" as TODAY.
- In case you do want to allow requests to be Recalled then set the value of the Status field as "Recalled" in the Recall actions.
This would be a better and more efficient approach to handle the kind of functionality you are building.Please excuse my interjection as I know you had simply asked for the correct syntax but looking at the names of the fields you were planning to use, I could not help but ask about the reasoning behind your approach.
Kind Regards,
Swarna.
Thanks for the formula anyway :-)
If you are not using the Approval processes then it makes sense.
Kind Regards,
Swarna.