I have an object with an hierarchical relationship. I have a trigger on this object that has On Create/On Update/On Finalize. This trigger looks at the parent relationship.
When I create a new object from inside the parent object by clicking the + sign after the list of child objects, the trigger does fire, but doesn't see the value of the parent relationship.
An example:
What happens is that the trigger does not see the parent group. If I edit the new child group, I do see the parent group set. If I then save the child group, the trigger fires again, and it does see the parent group.
How can I make the trigger see the parent group the first time around?
Could you do the following:
- Click on the + to create a new child group
- Click on Edit Page
- Select the Parent lookup field
On the top-left hand side, do you see the "Use Record in Scope for New Objects" checked or not?
The checkbox wasn't checked. Now it is, but it doesn't help. However, before, when the checkbox wasn't checked, the parent group would be correctly set after the child and parent group were saved, even though it wasn't selected in the parent lookup. Checking the checkbox doesn't seem to change anything; neither in the UI or the trigger.