shayota 9/11/2020 5:26:54 PM

SOPDeleteLineType Class - taSopLineDelete - how to delete multiple line items

Hi everyone,

I'm trying to figure out how to delete line items off of an invoice and have already come up with the code to do so.

The problem I'm having is that it can only delete one line at a time per eConnect document.

According to Visual Studio its telling me that the 'taSopLineDelete' property of the 'SOPDeleteLIneType Class' will not accept an array of objects and even when I separate it into separate declarations it only deletes the last item number in the array of objects.

ex. 

            SOPDeleteLineTypeObj.taSopLineDelete = itemArray[0];
            SOPDeleteLineTypeObj.taSopLineDelete = itemArray[1];

In this case the values of object itemArray[1] are the only values present in the xml, thus that is the only item that get's deleted off of the invoice.

Does anyone know how to get this to work with multiple line items on the same eConnect Doc?

I've only seen examples here on DynDeveloper of the functions deleting 1 line item.

The Microsoft documentation explicitly states that the 'taSopLineDelete' property describes "A collection of nodes that remove one or more sales invoice lines".

If this is true then how come it won't accept an array of the relevant objects?

 

I can post the code or XML if required but it won't be anything different from what all of you have seen before.

Any help is appreciated and thanks again.

Version: GP 2015
Section: .NET Development, Dynamics GP, eConnect


Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3