Populate Parent of Event using a custom field and Flow #inSalesforce

Populate Parent of Event using a custom field and Flow #inSalesforce

Each child event copies the field details from the parent event. As of now, there is no direct reference that an event is a child record and there is no actual lookup field referencing the parent event.

To check if a record is a parent or a child, use one of these standard references:

  • IsChild field - this is an audit field and can't be added to the page layout, but can be queried
  • Attendee field - if the event Assignee and the Attendee field organizer are not the same, the event is a child  
  • Editing the event - a child event cannot be saved if changes are made to any event field


Workaround to get the Parent event :

1. Create a custom URL field to display the URL of the parent Event record:

Create a new custom field on Activities | Set the field label as 'Parent' | Set the Field Level Security | Click Next | add the field to the Event page layout | Click Finish.

 2. Create a flow that auto-populates the Parent field:

  • Set up | Flows | Click New | Object: Event | Criteria : when a record is created | Decision : Criteria Name: Parent Event? Condition: IsChild Equals Boolean False
  • Update Element: Populate Parent field with parent Event URL | Field to update: Parent | Resource: Formula, Value: "https://d5g000001pmpgeai-dev-ed.lightning.force.com/" +{!$Record.Id} | Note: Value needs to be the home link to your Production organization in quotation marks, then insert the '+' sign, then insert the Activity Id field.
  • Save and Name the flow | Click Activate.

Now, the 'Parent' URL field will be populated with the link to the parent Event record, which would then be copied over to the child Event records created for each Event Attendee who is a user.

















Reference: https://help.salesforce.com/s/articleView?id=000383259&type=1

Comments