Skip to main content
Solved

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


  • Freshman I
  • 2 replies

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": [

        {

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

            "PurchasingDetails":

            [

                {

                    "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

 

Best answer by Vignesh Ponnusamy

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,

View original
Did this topic help you find an answer to your question?

3 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+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,


  • Author
  • Freshman I
  • 2 replies
  • June 6, 2024

@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


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2640 replies
  • July 25, 2024

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings