Ask Search:
Chris LeszkaChris Leszka 

Process Builder to create Assets from Opportunity Products on Closed Won Opportunity

I'm using Process Builder to create Assets on any Opportunity Products of a specific type whenever an opportunity is marked as Closed - Booked.  Since i have to reference the product family, and create assets based on the Opportunity Products, i've setup the Process to run off the Opportunity Products object.

The issue i'm running into is that i'll have an opportunity with products, and that opportunity's stage gets updated to Closed - Booked... Because the Opportunity products were added prior to the Opportunity stage being updated, the process is not triggering.  If after closing an opportunity i go into the products, make a change and hit save, then it runs just fine.

How do I get the Process to run on the Opportunity stage change?
Best Answer chosen by Chris Leszka
Jackie DoanJackie Doan
Hi Chris,

Instead of using a process to do this, have you thought of trying a process and a flow? You can set the process to run on the oppty stage change, then use a flow to loop through the products. 

All Answers

Jackie DoanJackie Doan
Hi Chris,

Instead of using a process to do this, have you thought of trying a process and a flow? You can set the process to run on the oppty stage change, then use a flow to loop through the products. 
This was selected as the best answer
Avner DafniAvner Dafni
Chris Leszka,

Can U tell me how you are looping on Products in Process Builder?

Avner
Chris LeszkaChris Leszka
Hi Avner,
I ended up creating the loop through a flow and then having the flow triggered via Process Builder on the opportunity stage change.

From my original, process builder only method - I had created a formula field on the Opportunity Line Item that referenced the Opportunity Stage.  The PB would then run through all OLI's that had a stage of Closed - Booked and create the assets on the account.  The problem was that the formula field updates weren't setting off a field change, so the process would never run unless I manually went into the OLI, made an update and then hit save.
Avner DafniAvner Dafni
I cant seem to get the right way to reach the data on my products in Flow.

I am:

- getting opptLineItems Array
- looping on them, getting opptLineItem Obj - PriceBookEntryId
- trying to get Product2 & its Data...

here are some screen shots.

what am I doing wrong?

User-added imageUser-added imageUser-added imageUser-added imageUser-added image
Chris LeszkaChris Leszka
It looks like the only big differences between your setup and mine is that i use regular Record Lookups for collecting the addition details like Product ID instead if Fast Lookups.  If i remember correctly, the additional Fast Lookups were causing me problems.  I went through my flow and grabbed some screen shots of everything, so hopefully this will help you troubleshoot.  Let me know if you have any questions, or want to see how i have the Process Builder setup to kick off the flow.
User-added image
User-added image
User-added image
User-added image
User-added image
 
Chris LeszkaChris Leszka
User-added image
User-added image
User-added image
User-added image
Mark KorfMark Korf
Chris,

I'm a reletively new Admin at a company that has been trying to solve this same issue for almost 6 months. I'm following your steps in the screenshots you've provided and duplicating the flow but have a few additional questions.

1) In your second screenshot of the 'Fast Lookup'... Are the fields selected fields you already had built in your org? Or were they additional fields you needed to create for the flow/process builder to function correctly?

2) It would be much appreciated if you could add screenshots of the process builder piece as well as you offer above.

We we're looking at having an outside dev team resolve this for us and they're estimate came bace at over $6K. I'm trying to hammer this out for us instead. It would be a huge win for us to figure this out and almost assuredly confirm my Dreamforce attendance request. Where of course I would buy you a beer! Or two! Lol!

Thanks and have a great day!
Mark 
Chris LeszkaChris Leszka
Hi Mark,

The lookup fields in that Fast Lookup are all fields that I created in order to make the flow work the way I needed it to. Converted_to_Asset__c was created as a boolean so that once a product was converted to an asset, if a change took place on the opportunity that would've trigger the flow to run again, it would prevent it from created duplicate assets.  Additionally, the IsAssetProduct__c field is used to identify which products should actually be converted to assets.  We have a some products that are sold as single transactions and others that are annual subscriptions.  We only wanted assets to be created for the subscriptions, so this field allows me to differentiate between which products should and shouldn't become assets.

As for the Process Builder piece, I have it set to run the flow whenever the opportunity stage is set to Closed - Booked (Closed Won).  In the screenshot below, all it's doing is assigning the values of my opportunity ID and my Account ID to the variable fields in the flow.
User-added image

Let me know if you have any other questions or want to walk through anything.  Solving this one was huge for us, so I 100% know where you're coming from on trying to figure it out on your own vs. spending the money to have someone else do it!
Mark KorfMark Korf
Chris,

Thanks a bunch, I'll be starting to tackle this today as Monday was, well...  a Monday. Thanks again for the detail and timely response. I'll let you know how it goes...

Mark
Christian StrøjerChristian Strøjer
Hi Guys. I need some help here. Everything over might work given my problem, but one thing i'm quite unsecure about is this. 

When we Create an Opportunity, we add products. Since we build self-service Kiosks we first need to decide on a Frame, then we add Components. I have done a list of types in order to differentiate between different product types (Frame, Component, SLA). Whenever we Close a deal we then need to move say 100 kiosks over to Asset in order for us to register everything from MAC-adress, IP, ..., ... How on earth am I able to ensure that all Frames will be created as "Asset Level 1" and Components as Level 2 AND ensure that every kiosk Component is a Child to my Frame? Maybe i'm using something wrong, if so, give me an idea to move on from here.