How to add new line in invoiced PO through X++ code

Hi all,

I created and posted a invoice through code for some date like june 10.

now i need to add additional lines to that PO and need to post.

I need how to add additional lines on that PO through code…

can i simply update the record in purchLine table or there is any standard to done this


if you want to add new lines, then you have to insert new records in PurchLine table but use the same purchTable record (that you have invoiced previously).

Also check the safety level of invoiced orders in Procurement and sourcing parameters, you will not be able to add lines if the value is Locked.