Hi all, we have one requirement when end user adding/creating record from landing page, on the process of creating record where it requires some mathematical calculations like finding total amount (Quantity * each item cost).
one way we can use declare expression to calculate total amount. any other alternative way to achieve this from landing pages?
Create custom Action for your data class, where you can utilize below features for your mathematical calculations,
Form refresh setting on scalar fields in flow action
Pre and Post processing DT/activity options where you can write your custom logic
Please note that this custom action is only applicable only for editing the existing records. For create scenario, pega will utilize the view type behaviour.
If you want the same behaviour while creating the records, then
For pre-processing, you can utilize the pyDefault DT
For post-processing, you can utilize the Data Transform in data save options in the savable data page of your data class. Just before the save you can do any modifications and they will be persisted.
If you opt to use the same post-processing DT for both create and delete scenarios, then make sure you have a flag setup for edit scenario and utilize the negation to identify the create scenario.
@JayachandraSiddipeta are you sure Form Refresh settings works at data- flow actions used with CRUD actions on data? I recall seeing somewhere that this wasn’t possible.
@VenkateswararaoK you could also do CRUD actions on data from Insights. Insights, in '25 have calculations built into the Insights itself. Different to the ‘data model > calculation’ that creates a declare expression. This might be an easy way forward too.