Issues between front end UI and backend/ calculations/ API

Hi all

Many thanks for your advice in your advance. 

I've noticed some issues with some records in the RLI module's field values not matching what we have in our SQL database. 

We use an api from our website to import a product into a field called applied product, this then updates a second field called applied size (it pulls a numeric value from the related product catalog module) , the applied size field updates on the UI, but doesn't in the backend of sugar/SQL database. 

If we then open the record, press the edit/save button I can see in the audit log that it then seems to recalculate correctly. I want to know if there is a way to make sure the calculations are always updated automatically without us needing to open/edit/save each record.


Many thanks

Jay

Parents
  • if applied size is a formula field and you are using the module's API (/rest/<version>/<module>/:record) with a PUT to set the applied product for that record, in other words you are using the Bean, then it should trigger the update. But if you are using a SQL INSERT or UPDATE to set the applied product, then the calculation will not trigger, it's the save action on the bean that triggers the recalculation of the formula field.

    Furthermore, if it's not a formula field, and you are setting the applied size through a controller (e.g. record.js or create.js) that's only front end code and will not apply to any API or SQL updates.

    Hope this helps,

    Francesca

Reply
  • if applied size is a formula field and you are using the module's API (/rest/<version>/<module>/:record) with a PUT to set the applied product for that record, in other words you are using the Bean, then it should trigger the update. But if you are using a SQL INSERT or UPDATE to set the applied product, then the calculation will not trigger, it's the save action on the bean that triggers the recalculation of the formula field.

    Furthermore, if it's not a formula field, and you are setting the applied size through a controller (e.g. record.js or create.js) that's only front end code and will not apply to any API or SQL updates.

    Hope this helps,

    Francesca

Children
  • Hi Francesca 

    Thank you for responding I really appreciate it!

    We use the api to push the product id directly into our Applied product field. At this point the applied size should pull the numeric value from the related product catalog record.

    I'm unsure on the actual method of pushing the data in, but am assuming the developer is using insert/update instead of put based on your explanation. Hopefully it's as simple as amending the method to put. 

    Many thanks

    Jay