save values from lookup

Posted by adina on 15-Nov-2014 10:35

Hi,

Into a portal page of type "Edit X" I have a grid control to manipulate child records from object Y.

On the child record there is also a lookup on the object Z.

What I want to do is when i select a value from lookup (select a record from Z), at submit to save into the child object Y some values from Z. The fields that I want to fill in at submit are only in the object (Y), and not in the grid control.

I created a trigger on after create on child object Y and it works, but i want also at update of child record (when lookup is changed) the new values to be saved.

How can I do this?

If I change a field in the grid control with records from object Y, it runs the on update triggers on the object X (the parent).

All Replies

Posted by Godfrey Sorita on 17-Nov-2014 09:12

Hi Adina,

Please uncheck all the timing of your trigger in object Y. Then, create a Run Triggers on Related Records trigger in object X with a timing "On Finalize". Make sure to select the specific triggers you want to run from object X to Y.

The "On Finalize" timing only runs after input from grid controls, embedded quick create, and survey components (if present on UI page) are processed. Since the timing of your trigger in Object Y is disabled, it will only run if the grid control is updated.

I'm assuming the relationship between your 3 objects are 1 X to many Ys and 1 Y to many Zs.

Regards,

Godfrey

This thread is closed