0

We have a web-based form that customers fill out and the data gets saved in a custom object called Book Requests. When the Book Request Record is saved, Process Builder generates the Account (always new) and Contacts (can generate as many as 3 new contacts). The Book Request Name is saved on both the Account record and the Contact record. Is there any way to "copy" the Account Name (Account Object) to Account the lookup field on the Contact? I've tried modifying a couple of different flows with out any success. I'm keeping my fingers crossed there is any easier way.

1
  • The short answer is Yes. You will need to create the Contact record as soon as you create an Account and populate the AccountId field on the created Contact.
    – Jayant Das
    Commented Feb 18, 2019 at 21:45

1 Answer 1

1

Process Builder does not provide the capability to store values (the Id of the created Account) and use them across different Actions (the action to create Contacts). To do that, you'd need to use Flows.

In Flow Builder, you do have the freedom to design sequences of dependent actions and to store state - the information you'd need from the outcome of Action A to successfully execute Action B.

Your Process Builder would have only one action, which would launch your Flow. Your Flow would start with a Create Records element to create the Account, which I'd think would look something like this:

enter image description here

Thereafter, you'd have to draw out your logic to create one or more Contacts. I'm depicting this here for a single Contact; your final Flow would probably build up a collection variable and then create them in one operation.

enter image description here

Note how the AccountId field is populated using the accountId variable, which was created upon the creation of the original Account.

Your final Flow would end up more complex than this one, because you'd have some type of conditional logic between your Account and Contact creation steps, but you'd still have those core sObject creation steps present.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .