How can I trigger a user event on a child record w...
# ask-stanley-ai
d
How can I trigger a user event on a child record when it is edited from parent record?
c
AI generated answer (using internal Slack threads):
To trigger a user event on a child record when it's edited inline through a parent record sublist, you would need to deploy a user event script on the parent record and check for sublist changes. Here's a general idea of how you might approach this: 1. Deploy a User Event script on the parent record. 2. In the
beforeSubmit
or
afterSubmit
function of the User Event script, check for changes in the sublist that contains the child records. You can use the
record.getSublistFields(sublistId)
method to get the fields of the sublist, and the
record.getSublistValue(options)
or
record.getSublistText(options)
methods to get the values of the sublist fields. 3. If there are changes in the sublist, trigger the necessary actions for the child records. Please note that attaching and detaching the child record should trigger user event scripts on the child. However, editing the records from the parent record via
Allow Child Record Editing
does not trigger user events on the child, you have to catch it from the parent. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.874605894
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840466857
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839001894
Please provide your feedback on this answer.