Skip to main content
Solved

how to find purchase details for sales order line (LineNbr=1)

  • 5 June 2024
  • 3 replies
  • 54 views

Hello 

I’m trying to update SalesOrder PurchasingDetails through this url: PUT method https://gtp.acumatica.com/entity/DefaultEndPoint/23.200.001/SalesOrder/?$Expand=Details

using this script:

{

    "id": "91bdadf9-ef21-ef11-835e-06ae6affe5a5", 

    "Details": e

        {

            "id": "c5ce115a-f021-ef11-835e-06ae6affe5a5",

            "PurchasingDetails":

            a

                {

                    "POOrderType":{"value":"SO"},

                    "POOrderNbr":{"value":"Code-000396360"},

                    "POOrderLineNbr":{"value":1},

                    "Selected":{"value":true}

                }

            ],

            "VendorID":{"value":"V10156"}

        }             

        ]

    }

i getting this error message: 

"innerException": {

            "message": "An error has occurred.",

            "exceptionMessage": "Purchase Order Line (Order Type = SO, OrderNbr = Code-000396360, LineNbr = 1) cannot be found in Purchasing Details for Sales Order line (LineNbr = 1).",

            "exceptionType": "System.Exception",

            "stackTrace": "   at PX.Objects.EndpointAdapters.DefaultEndpointImpl22.LinkSOandPO(SOOrderEntry soOrderEntry, SOLine transaction, EntityImpl targetEntity, EntityImpl.] purchasingDetailsEntities)\r\n   at PX.Objects.EndpointAdapters.DefaultEndpointImpl22.SalesOrderDetail_Update(PXGraph graph, EntityImpl entity, EntityImpl targetEntity)"

i retrieved this data using this url get request:  https://gtp.acumatica.com/entity/DefaultEndPoint/23.200.001/SalesOrder/SO/Code-000396360?$Expand=Details

 

i already created Purchase order for that order using this script:

url POST https://gtp.acumatica.com/entity/DefaultGTPEndPoint/23.200.001/PurchaseOrder/approve

{"entity": {

        "VendorID": {

            "value": "V10156"

        },        

        "Location": {

            "value": "04"

        },        

        "Type": {

            "value": "Normal"

        },

        "OrderNbr": {

            "value": "<NEW>"

        },

        "VendorRef": {

            "value": "PO060324-2"

        },

        "Description": {

            "value": "Test"

        },

        "Owner": {

            "value": "art"

        },

    "Details": Â

            {

                "InventoryID": {"value":"BC3001NVY-XL"},

                "OrderQty": {"value": 1.00},

                "UnitCost": {"value": 59.99},

                "POLineNbr": {"value": 3},

                "POOrderNbr": {"value": "Code-000396360"},

                "ReceiptQty": {"value": 1}

            }

    ]        

    }

}

Thank you for your help

 

3 replies

Userlevel 7
Badge +5

Hi @art,

To update the existing detail lines, it would be a two-step process. 

  • Do a GET Request
  • Do a PUT Request with the header key fields and use the ID from the detail lines to update that specific detail line

For more details kindly refer the example here, https://help.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=a91733a5-2f47-435d-b4c9-c08282630532

Feel free to post back if you have any questions.! Good Luck,

@Vignesh Ponnusamy Thank you for your response

i’m trying to create po, then updated the created sales order right now i need  one post request to create the po, one get request to get the newest purchase order number, then one get request to sales order to get the IDs, am i correct?

salesOrderUpdae= {   

    "id": "06e637b3-3b23-ef11-835e-06ae6affe5a5",

   

    "Details": [

        {

            "id": "249a3fb9-3b23-ef11-835e-06ae6affe5a5",

            "PurchasingDetails":

            [

                {

                    "POOrderType":{"value":"Normal"},

                    "POOrderNbr":{"value":"PO0000001520"},

                    "POOrderLineNbr":{"value":1},

                    "Selected":{"value":True}

                }

            ],

            "VendorID":{"value":"V10156"}

        },        

        ]

    }

Thanks

Userlevel 7
Badge

Hi @art were you able to find a solution? Thank you!

Reply