Update only modified records

 

I have created a behavior action designed to update the database. However, I would like to restrict this update to only related records whose parent-child relationships have undergone recent modifications, thus avoiding unnecessary synchronization of a large volume of data. Is it possible to achieve this? Can anyone provide help?

For example, consider a table called "supplies," which contains items such as drinks and meals. Additionally, there is a secondary table called items, which presents various versions of the items with additional information such as brands and sizes.

The premise is that the unit cost of an item in the supply table must be equal to the maximum value recorded in the secondary item table.

To perform this process, I execute an action on a specific set of rows [Related Record].

However, currently this action affects the entire database and I need to introduce a condition that allows me to select only the records in items that have undergone changes.

For example, if I have updated the price of a lemon drink, I want the unit cost of the drink supply to be updated, but the rest of the records should not be affected by this process.

0 6 138
6 REPLIES 6

Not 100% sure if i understood your case.. let's try to simplifier it.

#1 - You have parent - child relationship.
#2 - Do you want ot update the related childs when the parent is updated or the opposite?
#3 - How is the action triggered? From the parent or child table?

Good morning Aleksi!!! how are you? I want to update the parents using an action that detects which child record has changed.

#1. Yes, parent table is inputs and child table is items

#2. I want to update the unit costs of the parent table based on the child records that have been modified, but not update the entire database but only those that have children that have changed.

#3. The action is triggered from the main table.

 

Por ejemplo, si tengo varios registros hijos, 

Why don't you trigger the action to update the parent when the Child record is updated? You may want to add a condition when only some columns are updated in the Child record. Would that be an easier way?

do you think of a bot Aleksi?

With the Bot you will have more possibilities to control the condition, but I was thinking just a normal action. You can trigger it from the Child's form view with the Event action.

I will try!!! I think it's great!

Could you give me an example, if it's not too much trouble, Aleksi, what would go into the expression of the action, for example, and which of all the actions it would be.

Top Labels in this Space