Showing results for 
Search instead for 
Did you mean: 
Sushi Chef aidankirkpatric
Sushi Chef

Has anyone tried using the Process Builder to populate Work Details from Quote Lines?

I have automated the creation of Work Orders from successfully won Opportunities (using the Process Builder), but now want to go one step further and add in the synchronised quote's line items into the Work Order's Work Details list.  I can not find the right related objects in order to do this, so was wondering if anyone else has done anything similar, and if so how they might have done it.

Message 1 of 3
2 Replies
Sushi Chef dbrieck
Sushi Chef

Re: Has anyone tried using the Process Builder to populate Work Details from Quote Lines?

Here's how I would approach it.

  • When the opportunity is won, modify a field on the quote lines. I personally would use a checkbox field. You can probably do this in the same process you built to create the work order. You can modify all related records easily in process builder.
  • Create a process on the quote line so that when it's edited and that checkbox is created the process kicks off. (that's why we need to check the box in the previous step) This needs to be a separate process from the original one.
  • The process should trigger the creation of a record related to the one that triggered it. Assuming the other process to create the work order stored the new work order on the Opportunity, this is simple.
  • You then just need to map the work order (on Work Detail) as a reference to the Work Order on the Opportunity, then map the values from the quote line to the work detail line and set any other fields as required.

I've done this both for Part Requests/Lines to Work Order/Detail, as well as an integration with our ERP to map lines from our ERP to a Part Request Line or Work Detail.

Message 2 of 3
Sushi Chef aidankirkpatric
Sushi Chef

Re: Has anyone tried using the Process Builder to populate Work Details from Quote Lines?

Thanks for that David.  I will openly admit that I didn't totally follow what you have done, but your approach clearly ignited something in my head as I have since found a solution!

I have ended up using the Process Builder to start the process off (a Trigger would have sufficed, but I already had a Process), and then created 2 autoflows (the first called from the Process, the second called from the first).  The Process Builder passed the Opportunity ID into the first Flow, which looked up lots of related data and created a new Work Order populated from the new data.  The first Flow then passed the new Work Order ID and Synced Quote ID into the second flow, which used a lookup, a loop, a subject collection variable and a fastcreate to populate the Work Detail Lines.


First Flow:

Second Flow: (This could have been a part of the first flow).

I only had two "issues" when I did this.  The first was that when I tried to assign a Discount, it appeared in the Work Detail 100 times too small.  In order to rectify this I used a formula "{!CurrentLineItem.Discount} * 10000", oddly multiplying the Discount by 10000.  I still haven't figured out why this was necessary.  My second issue was that I was passing in List Price and Sales Price from the Quote into Line Price and Billing Price in the Work Detail and the correct totals were not being produced in the Work Order!  This turned out to be because the SM controlled formula for Total Line Price (Work Detail) does not actually use the Billing Price field! (Not sure where this is used yet!?!?)  The solution was that as Sales Price defaults to List price when generating a Quote Line, I just passed the Sales price into the Work Detail List Price (making sure to uncheck the "Use Pricebook Price" checkbox).

I just thought I would post this, in case anyone else was having similar issues!

Message 3 of 3