• Jason, Kim
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I have created an action in process builder to Create a new contract once the Opportunity stage = Closed Won.

This is occurs when a record is created or edited, and I have unchecked the checkbox asking whether to Allow process to evaluate a record multiple times.

So the criteria to be met is Opportunity Stage = Closed Won

The first action I have written is to create a new contract, with the fields as follows:

 

User-added image
However, similar to how there is a lookup field on Contract Stage to link back to Account and (in this case, I have created another custom lookup field to link to Opportunity) Opportunity as well, I would like to have a lookup field on Opportunity stage to link to Accounts.

This Contract field on Opportunity object is just the mirror image of the Opportunity lookup on Contract object.

What I want to do is be able to, upon marking the Opportunity as Closed Won,

1) Create a new contract (all good this works already)

2) Update the previously empty Contract lookup field on Opportunity object with the Contract ID of the newly created contract.

I am having trouble completing step 2. 

I tried adding another action to Update the contract lookup field on Opportunity object 

User-added image
But upon marking an opportunity as closed won, I get the following error

 

An error occurred at element myRule_1_A3 (FlowRecordUpdate).
The flow failed to access the value for myVariable_current.Contract.Id because it hasn't been set or assigned.

Any ideas on how to automate this? Ideally, I would want users to be able to access the corresponding Contract immediately upon marking the Opportunity as Closed Won, as opposed to having to go to Contract object and searching for that contract.

I swear I'm somewhere close to the answer as I can successfully import the ID of the opportunity when creating a new contract (see first photo I inserted above)

Thanks!