How to trigger computed fields to update from changes made by a script?

How to trigger computed fields to update from changes made by a script?

mikebruno1462
Explorer Explorer
143 Views
2 Replies
Message 1 of 3

How to trigger computed fields to update from changes made by a script?

mikebruno1462
Explorer
Explorer
In a workspace, I have Field A which is a Linking Picklist into another workspace.  It is convenient for us to have another field which summarizes the list in Field A.  The summary field, Field B, is single line text and a computed field.  The formula for Field B is trivial (thanks to this forum) - COALESCE(REPLACE(FIELD_A, '<BR/>', ', '), '').
 
Unfortunately, I have several hundred items which have an incorrect link in Field A that must be removed.  I can create a view to find them, a script to operate on them to iterate through Field A and remove the offending link, and using a fantastic tool written but unsupported by Autodesk, I can run that script over the items in the view.  All that works quite well.
 
What does not work is that the computed field, Field B, does not update.
 
  • I run the script over an item.  The link is removed from FIELD_A.  The computed field does NOT update.
  • I run another (action) script over the item that performs some validation and writes its results to a text field on that item.  The computed field does NOT update.
  • In the UI, I pull up the record, press Edit, and immediately press Save without changing anything.  The computed field DOES update.
 
So there are clearly some rules about what actions trigger updates on a computed field.  I have looked through the docs and the forum without finding information on this topic.  Is there a methodology to get a script to cause an update to computed fields?
 
Thanks,
Mike
144 Views
2 Replies
Replies (2)
Message 2 of 3

bhavani_sankuratri
Autodesk
Autodesk

Hi @mikebruno1462 ,

 

Hope you are doing well! I just wanted to follow up on this. Were you able to find a way to update the computed field automatically after your script changes Field A? If you found a solution, please share it here so it can help others with the same scenario.

Bhavani Sankuratri | Community Manager
0 Likes
Message 3 of 3

mikebruno1462
Explorer
Explorer

Due to other demands, I have not found a solution to this particular problem.  My intent is to try something quick via the API to see if that would trigger an update but I have not had an opportunity to do so.

0 Likes