I haven't found a solution online for this yet and it seems I have run across this error but no valid solution yet.
Error when invoicing invoice number: TestMultPOs on Purchase Order: PO-012-031705 The purchase order or product receipt was corrected after the vendor invoice was created.
All accounting distributions must be re-created to reflect any changes to the purchase order's or product receipt's accounting distributions.
I have x++ code that looks up a purchase order in ax 2012. It will generate the vendInvoiceInfoTable, vendInvoiceInfoSubTable, vendInvoiceInfoLine_Asset, and vendInvoiceInfoSubLine with the product reciepts. I have been able to post and invoice just fine.
The issue is when I want to add multiple lines in vendInvoiceInfoLine that have a different Purchase order. I get this error everytime and i'm not sure what parameter needs to be set or what do I need to do to get this to work. It works fine in the front end of course. I can post my code if we need details but wondering on a high level first if anyone knows the answer to this.
One thing I did notice is when i invoice through code it looks like this in the front end. 
When i invoice in the front end without going through code, it looks like this 
The difference I can tell is the Purchase order field says <multiple> .. Something i need to fix there i bet as well as the actual option to post under actions (the button) dissapears.. any ideas thanks?