I am trying to set up a workflow to convert a saved Estimate to an Invoice but the line-items are not converting? Any help appreciated.
The workflow so far:
Step 1 - I set the status of the Estimate to
Deleted so that it no longer shows as an active estimate.
Step 2 - I create a new Invoice with the invoice Notes being a result of Step 1. This works and the resulting invoice successfully displays the Notes, VAT rate etc.
Step 2 -
Make changes to Invoice... this should convert the estimates line-items over to the new invoice. I am unable to get the LineItem info showing, I’ve tried numerous things but I always get red error text, does anyone see where I’m going wrong?
Hi there, @darren.james7518… it likely won’t be this simple, but try changing the add operator to add list or set list and see if you get the desired result.
Yep, as @mikeloc says, the ‘Add’ operator is only for adding single items to a list.
Presumably the Estimate has a list of line-items, so you’ll need to use ‘Add List’ (or ‘Set List’) to add a list of items to a list.
Thanks guys, I did try both Add List’ and ‘Set List’ but I get the red error. It always need more info;
Then there must be a ‘type’ mismatch between what you’re trying to add and the type of data being expected.
Having just had another quick look at your app, they are two completely separate datatypes (‘Estimate Lineitem’ and ‘Invoice Line Item’) - so you won’t be able to add one to the other…
You’ll either need to change your database structure so that the Estimate and Invoice both use the same datatype for their line-items list (I’m not sure why you need two separate datatypes for that anyway)…
Alternatively, you’ll need to create a list of Invoice Line Items, one for each of the list of Estimate Lineitems, then add those Invoice Lineitems to the Invoice.
Ok, thanks, I think I will try this. So basically you are saying that I only need one datatype for line-items and both Estimate and Invoice will share it. I didn’t do this because I thought there would be confusion somewhere, will try now!
So basically you are saying that I only need one datatype for line-items and both Estimate and Invoice will share it.
That will be the simplest way - and the way that works faster for the UX - just add a ‘type’ field on the line-item so there’s no confusion between the two types if that’s necessary (I’d use an option-set for that).
Yes, you can use the same list of line items, but in case you want to do corrections to the invoice line items, this will update the estimate line items as well, just FYI in case you want to compare the estimate with the invoice at one point.
A workaround for this would be to create separate amounts and units in the same data type. So you would have estimate line amount and invoice line amount, and then just setup the workflow to work around these.
When creating an estimate line item, you can have it populate the invoice amount, and then if you do any changes in the invoice, the workflow would only change the invoice line amount
Thank you @pfthiessen this is a good idea. I think I will be OK without this though because the estimates are always just a temporary thing - users will send an estimate to their client and as soon as the client agrees the estimate price, the user will then convert it to an invoice and the estimate is deleted.
Thanks again @adamhholmes, this solution worked great