1

In Account object I am having a formula field with address details and its related with other object (Lookup field), if any update happens means it should be reflected in account object based if the status is Active otherwise the previous value should be reflected.

Is it possible?

3 Answers 3

1

Formula field calculate value at runtime so it can't support your usecase but you can use following workaround

  1. Create another field text type.
  2. Fill that field using trigger.
  3. Refer that field in your formula field.
1
  • @Saroj Thanks for your response could you give me sample code for that.
    – Nikitha
    Sep 25, 2015 at 6:53
1

Yes there is a function available called PRIORVALUE. But if you are creating formula field this won't give priorvalue for other fields.you can try to create workflow rule with criteria "created, and every time it’s edited", add a custom field on object and then update that field on the object. Here is a similar discussion thread you can go through.

1

yes, it can be done.

  1. Let's say current_field is the field, then you would have to create another field called old_field.
  2. Create a workflow rule to update the value in old_field. You will use update action and a FORMULA to return the PRIOVALUE(current_field). The reason why you will no use FORMULA Field is because PRIORVALUE Function is not available in Formula Fields.
  3. Now that you have both current and prior value, you could apply any logic on this.
1
  • This answer is more or less a duplicate of Himanshu's.
    – Adrian Larson
    Apr 4, 2017 at 19:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .