How to update "Expression" value

Posted by Roman on 22-Dec-2013 00:02

Hi,

I noticed that value generated by formula from "Expression" is not automatically updated.

Please provide with a solution (Triger example) how to update Expression value on the daily basis.

All Replies

Posted by Bill Wood on 22-Dec-2013 04:14

Can you clarify your problem, please?
I assume you are talking about a Formula field on an object.   
I believe that these are evaluated when any of the fields that the formula depends on are updated.  You should not have to call a trigger to change them.  
Does your formula depend in an externally supplied value (like "currentTime") or a call to an external service?   

Posted by Roman on 22-Dec-2013 05:22

There is "Formula" filed and there is "Expression" field.

I'm talking about "Expression" field.

Formula that I'm using is depended on external supplied value - getCurrentDate.

Posted by bakar on 22-Dec-2013 05:25

Expression field has some limitations on its own:

• Expression's JavaScript code cannot include loops and references to related records.

• Expression will not be updated when related records are updated.

• Expression fields are updated whenever record is created and updated -- not when record is viewed.

• Once created, data type of expression cannot be changed.

• Unlike Formula fields, Expression fields do create actual database column, so they are subjected to limitations on number of columns per Object.

• You can use server-side API to query Expression field.

Posted by smartsysISV on 22-Dec-2013 12:47

You can update a objects expression-fields with an object-script.

ex.

var arr = [];

rbv_api.updateRecord("objectname", "{!id}", arr);

Posted by Roman on 23-Dec-2013 09:25

Used following work-around:

1. Created new Integer field

2. Created new "Update Field Value" trigger

3. Set this trigger to update new Integer field with a value from the formula field

This thread is closed