+ Start a Discussion
Michael DaltonMichael Dalton 

Adding line items to an invoice using flow.

We have been designing a FLOW within a demo org and have hit a brick wall.

We have created a flow using a custom button on an opportunity record that creates a new invoice and drags the amount, account id and some other data into the INV record.

How can I extend its usage by pulling the products into the line items within the invoice using flow? Any idea's?

I started by using an opportunity line item lookup to gather the data and assgined to variables. The problem I face is getting that data to show on the INV record of the specific opportunity.
Salesforce WizardSalesforce Wizard
Are you looking to Add list of products to the INV record you're creating in the flow?

To do that you'll need a fast lookup to get your Opportunity LIne Items.

Then you'll need to Loop through each line item and assign the values to whatever you call your version of Products on the INV record. For simplicity I'll call it INV Products.

During the loop you should have an assignment element that assigns the values from each Product to a INV Record - Then have another Assignment that adds the Sobject INV Products Record to an Sobject Collection of INv Products.

Once the loop is done you can have a fast lookup to create all the Inv Products within your Sobject Collection.

I have an example of using a Loop and Fast Lookups here: http://salesforcewizard.wordpress.com/2014/07/10/letter-to-the-developer-the-date-loop-to-create-records-with-flow/
Matt Sutton 7Matt Sutton 7
The issue I can see with this is you are using a Custom Button to launch the flows and SObject variables from Fast Lookups won't work with Custom Buttons and user inputs?  I'd love to be wrong on that though

Eric Latreille 8Eric Latreille 8
Hi, this is exactly what I am trying to do and it seems that I cannot get into that loop. I have an example of cloning an opportunity with the products and works well but when trying to assign that line to another object that is not an opportunity it seems to be a problem. The link above is not working, I will be curious to see the example :) thanks!