function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Elizabeth1842Elizabeth1842 

process builder - create a record related to contact based on the user

Hi -

We have a custom "Student Events" object that has a related list for Attendees. We'd like to be able to automatically create an Attendee record based on the creator when the record is created. I've tried using Process Builder to create an Attendee record for the contact record related to the user (CreatedBy.Contact.Id) but it fails:
The flow failed to access the value for myVariable_current.CreatedBy.Contact.Id because it hasn't been set or assigned.

All users in the system are also Contacts. Is what we're trying to do possible in Salesforce?

Thanks!
VIGNESH BALASUBRAMANIANVIGNESH BALASUBRAMANIAN
Hi,

You want to create Attendee record when Student Events record is created am i right ? If,Im wrong can you expalin even more In-detail..

Can you mention what relationship between Student Events and Attendee(Master-Detail or Lookup Relation)..


Thanks & Best Regards,
Vignesh.B

 
Elizabeth1842Elizabeth1842
Yes, that is correct. "Attendees" is a juntion object between Contacts and Student Events that has master-detail relationships to both.

Thank you,
Elizabeth
VIGNESH BALASUBRAMANIANVIGNESH BALASUBRAMANIAN
Hi,

As you said Attendee has M-D relationship with Contact and Student Events.So both Contact and Student Events fields are mandatory in Attendee.

1) Lets do one thing create lookup relationship to Student Events from Contact and select Student Event record when create a contact record as mentioned below...

User-added image

2) Create Process(Process Builder) and Choose Contact object and select only when a record is created condition

User-added image

3) In Entry Condition give formula as ISNEW() ( which means when new contact is created)

User-added image

4) Then Add Action to create Attendee record and map values

User-added image


5) Finally Activate the Process builder and Check it.

If you create a contact record (select Student Events record using lookup field in contact) a new attendee record will be created automatically.


Thanks & Best Regards,
Vignesh.B
Elizabeth1842Elizabeth1842
Thank you very much for your response, and I'm sorry I wasn't more clear. What we're trying to do is that when a new "Student Event" record is created, an Attendee record is auto created based on the current user. All users are contacts in the system and we would like the user who creates the Student Event to automatically be added as an Attendee.