drosa 11/5/2018 7:01:14 PM

GP WebServices: Can't update Sales Order w/ Lot information.

I'm writing a Web Services integration for GP. I'm utilizing the UpdateSalesOrder method, pulling the existing Sales Order object using the Sales Order ID, and supplying a new set of SalesOrderLines, with Lots filled out.

The goal is that our system controls order/lot information, and we're exporting information to update the GP Sales Order and its lines. For an order we export an Item key, its lot keys, lot quantities, and an item quantity (total of lot quantities) and want to make these allocations in GP.

I have a basic test: Updating Sales Order with 1 Line Item and 1 Lot on the item. In my C# code I've set the SalesOrderLine Quantity, QuantityAllocated, QuantityFulfilled to 5, and SalesOrderLine's only Lot Quantity to 5 as well.

 

I'm getting Lot Quantity Fulfilled does not match the Sales Line Fulfilled. AllocateLotBehavior = 1.”  

UpdateSalesOrder Allocate Lots Behavior is set to Manual.

I checked a SQL Trace of taSopLotAuto and saw @I_vQUANTITY=5.00000; @I_vQTYFULFI=default (It looks like this might be the cause)

- If @v_QTYFULFI being sent needs to be the value on Line Item (5), how do I do that? (SalesLineLot object from web services only exposes Quantity)

XML from exception console:

 

<Lines>
    <SalesOrderLine>
        <Extensions/>
        <Key>
            <SalesDocumentKey>
                <CompanyKey>
                    <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
                </CompanyKey>
                <Id>DR1005</Id>
            </SalesDocumentKey>
            <LineSequenceNumber>0</LineSequenceNumber>
        </Key>
        <Quantity>
            <Value>5.00000</Value>
            <DecimalDigits>0</DecimalDigits>
        </Quantity>
        <IsNonInventory xsi:nil="true"/>
        <IsDropShip xsi:nil="true"/>
        <RequestedShipDate>2017-04-12T00:00:00</RequestedShipDate>
        <DeleteOnUpdate xsi:nil="true"/>
        <TaxBasis xsi:nil="true"/>
        <IntegrationSource xsi:nil="true"/>
        <WarehouseKey>
            <Id>WAREHOUSE</Id>
        </WarehouseKey>
        <ItemKey>
            <Id>TESTLOT</Id>
        </ItemKey>
        <ShippingMethodKey>
            <CompanyKey>
                <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
            </CompanyKey>
            <Id>LOCAL DELIVERY</Id>
        </ShippingMethodKey>
        <SalesTerritoryKey>
            <CompanyKey>
                <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
            </CompanyKey>
            <Id>TERRITORY 1</Id>
        </SalesTerritoryKey>
        <SalespersonKey>
            <CompanyKey>
                <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
            </CompanyKey>
            <Id>PAUL W.</Id>
        </SalespersonKey>
        <PriceLevelKey>
            <CompanyKey>
                <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
            </CompanyKey>
            <Id>RETAIL</Id>
        </PriceLevelKey>
        <ShipToAddressKey>
            <CompanyKey>
                <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
            </CompanyKey>
            <CustomerKey>
                <CompanyKey>
                    <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
                </CompanyKey>
                <Id>AARONFIT0001</Id>
            </CustomerKey>
            <Id>WAREHOUSE</Id>
        </ShipToAddressKey>
        <ShipToAddress>
            <Extensions/>
            <Line1>11403 45 St. South</Line1>
            <Line2/>
            <Line3/>
            <City>Chicago</City>
            <State>IL</State>
            <PostalCode>60603-0776</PostalCode>
            <CountryRegion>USA</CountryRegion>
            <Phone1>
                <Value>31255501020000</Value>
            </Phone1>
            <Phone2>
                <Value>31255501020000</Value>
            </Phone2>
            <Phone3>
                <Value/>
            </Phone3>
            <Fax>
                <Value>31255501020000</Value>
            </Fax>
            <Name>Aaron Fitz Electrical</Name>
            <ContactPerson>Bob Fitz</ContactPerson>
        </ShipToAddress>
        <Taxes/>
        <QuantityToBackorder>
            <Value>0</Value>
            <DecimalDigits>0</DecimalDigits>
        </QuantityToBackorder>
        <QuantityToInvoice>
            <Value>5.00000</Value>
            <DecimalDigits>0</DecimalDigits>
        </QuantityToInvoice>
        <QuantityCanceled>
            <Value>0</Value>
            <DecimalDigits>0</DecimalDigits>
        </QuantityCanceled>
        <QuantityFulfilled>
            <Value>5.00000</Value>
            <DecimalDigits>0</DecimalDigits>
        </QuantityFulfilled>
        <QuantityAllocated>
            <Value>5.00000</Value>
            <DecimalDigits>0</DecimalDigits>
        </QuantityAllocated>
        <FulfillDate xsi:nil="true"/>
        <ActualShipDate>2018-11-07T00:00:00</ActualShipDate>
        <Components/>
        <Serials/>
        <Lots>
            <SalesLineLot>
                <Extensions/>
                <DateReceived xsi:nil="true"/>
                <DateSequenceNumber xsi:nil="true"/>
                <IsPosted xsi:nil="true"/>
                <DeleteOnUpdate xsi:nil="true"/>
                <LotNumber>TESTLOTDRAla1</LotNumber>
                <Quantity>
                    <Value>5.00000</Value>
                    <DecimalDigits>0</DecimalDigits>
                </Quantity>
                <ManufacturedDate xsi:nil="true"/>
                <ExpirationDate xsi:nil="true"/>
                <UserDate>2018-11-07T00:00:00</UserDate>
                <Key>
                    <CompanyKey>
                        <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
                    </CompanyKey>
                    <SalesLineKey>
                        <CompanyKey>
                            <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
                        </CompanyKey>
                        <SalesDocumentKey>
                            <CompanyKey>
                                <Id xmlns="http://schemas.microsoft.com/dynamics/2006/01">-1</Id>
                            </CompanyKey>
                            <Id>DR1005</Id>
                        </SalesDocumentKey>
                        <LineSequenceNumber>0</LineSequenceNumber>
                    </SalesLineKey>
                    <QuantityType>On Hand</QuantityType>
                    <SequenceNumber>0</SequenceNumber>
                </Key>
            </SalesLineLot>
        </Lots>
        <Bins/>
    </SalesOrderLine>
</Lines>
Version: GP 2015
Section: .NET Development, Dynamics GP, Web Services


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