I have an expression that counts days in a status. According to the documentation, expression values are only updated when the object is updated.
When generating a Chart based on this expression, the Day Count is correct in its calculation - however, no updates occurred on these records until their status changed..
When I create a batch job to update (increment) a field, an API update does not trigger an Expression value update.
When I update the object via the UI, the Expression value is re-calculated.
For a work-around, I can move the expression code to the batch job and use an integer value for the job update.
But, the update process appears to differentiate between UI vs. API with respect to Expression Value.
And Charts, those appear to calculate expressions on each request,
Does the same API limitation on Expression Values updates apply to REST and JAVA calls too?.
Defect has been fixed and will be available for 4.0.0.0 release. Regards, Orchid
Oh - and for that work-around, do not use a LOOP (with or without a view) because they won't be fixed until 3.2.0.0. A Select Query to retrieve a View is needed to perform the updates.
Are you using updateRecord() API?
Actually, that didn't work. I have had to use setField().
The object in question also has a trigger-based combined field validation on before create and before update. When I used update_record, it returned an error indicating that a conflict occurred. Apparently Rollbase is responding like createRecord() was called when updateRecord() is run from a batch. Call that another "undocumented feature."
Also, from the way batch works, it only iterates through all records. So I cannot filter the batch to only those records that need an update. Loop wouldn't even work anyway due to this.
So you use rbv_api.setField() in Batch job, and that did not update Expression field?
That sounds like a bug.
No, it did not. I had to remove the Expression field from the object and manually update a new field with the same formula.
Tracking issue as PSC00328582
Thanks [mention:05b5f00eae4a468d844fa8bedcafd110:e9ed411860ed4f2ba0265705b8793d05] for filing the defect.
Regards,
Orchid
Defect has been fixed and will be available for 4.0.0.0 release. Regards, Orchid