AnsweredAssumed Answered

Best Practice for Updating Calculated Field Values that Contain Related Data

Question asked by chadhutchins on Aug 14, 2015
Latest reply on Feb 1, 2016 by Vincent Amari
What are the recommended best practices for initializing/updating calculated field values that include a related field?

When you first create a calculated field, until you edit/save a record, the calculated field values will not be populated. Here are the methods I know:

1) Use the "Mass Update" tool from any list view. For example, go to Contacts, Select All Contacts, then run a "Mass Update" on any field. This will trigger each record to be edited/saved and will update the calculated field record. You can "Mass Update" a field that is not being used on the module or you can create a custom field just for this. 

Problem: If you have lots of records in a Module you will run into the 1000 record list limit or the mass update will time out. 

2) Write a custom script that will programmatically go through each of your records using the SugarBean, and run a save. It also looks like there is a updateCalculatedFields method and updateRelatedCalcFields method in SugarBean that might be better to use than a full-save. 

Problem: Requires someone with Sugar coding experience to create a script. If you're using On-demand, the customization would need to be packaged up and installable. You may have unwanted logic hooks that are run.

Are there any other ways to do this that is reliable and can be executed by a Sugar admin user that does not require custom code?