Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

RE: Deserializing object in custom service D365

$
0
0

Hi Martin,

The below custom service method is called properly from my client. But, empty values are inserted in the table.

For e.g. value for tPurchHeader.OrderNo getting assign to 0. The JSON string sent from client is correct. There seems to be some issue at the custom service end while receiving.

    [SysEntryPointAttribute]
    public str insertSingleHeader(PurchaseOrderHeaderContract _header)
    {
        TPurchHeader tPurchHeader;
        TOrderType   tOrderType;
        try
        {
            ttsbegin;
            tPurchHeader.clear();
            tPurchHeader.OrderNo = _header.parmOrderNo();
            tPurchHeader.OrderNotificationDateTime = _header.parmorderNotificationDateTime();
            tOrderType = str2enum(tOrderType,_header.parmOrderType());
            tPurchHeader.OrderType = tOrderType;
            tPurchHeader.WarehouserOrderNumber = _header.parmWarehouserOrderNumber();
            tPurchHeader.AccountNum = _header.parmVendAccount();
            tPurchHeader.InventLocationId = _header.parmInventLocationId();
            tPurchHeader.InventSiteId = _header.parmInventSiteId();
            tPurchHeader.insert();
            ttscommit;
            return "PO Header created.";
        }
        catch
        {
            return "Not inserted.";
        }
    }



Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>