Solved

Update Commitment details in change orders from REST API

  • 14 November 2022
  • 3 replies
  • 243 views

Good day, everyone.

We are attempting to update the Commitment tab details in the change order screen using the REST API, but we are encountering problems when updating the Commitment type and Commitment nbr values from the API.

Commitment type is set to Purchase order by default, and if we assign PO transaction values to Commitment nbr. from API, it works fine because PO values are already loaded into selector.

 

However, when we assign "Subcontract" type to Commitment type and subcontract # to Commitment nbr via API, we receive an error stating that the subcontract was not found in the system.

 

The JSON and URL for this call are shown below. Can anyone suggest a solution to this problem?

PUT: {{SiteURL}}entity/DefaultEx/18.200.001/ChangeOrder

{
"RefNbr": {
"value": "000020"
},
"COMMITMENTS": [
{
"ACCOUNT": {
"VALUE": "51250"
},
"AMOUNT": {
"VALUE": 600432.0000
},
"CostCode": {
"value": "00000"
},
"DESCRIPTION": {
"VALUE": "CONSTRUCTION API 1"
},
"INVENTORYID": {
"VALUE": "CSTRSUBCON"
},
"PROJECTTASKID": {
"VALUE": "09"
},
"QTY": {
"VALUE": 0.000000
},
"CommitmentType": {
"VALUE": "Subcontract"
},
"PONBR": {
"VALUE":"SC-000001"//"PO001295"
},
"POLINENBR": {},
"UNITCOST": {
"VALUE": 0.0000
},
"UOM": {
"VALUE": "LS"
},
"VENDOR": {
"VALUE": "SUNTECH"
}
}
]
}

 "exceptionMessage": "ChangeOrder.Commitments[0].PONbr: Commitment Nbr. 'SC-000001' cannot be found in the system.

Acumatica version: 21.217.0035

 

Thanks

icon

Best answer by Vignesh Ponnusamy 17 November 2022, 20:12

View original

3 replies

Userlevel 7
Badge +11

Hi @srikanth56 ,

The PO Type will auto-populating based on the PO Number and the POLineNr. No need to pass the POType. 

Please check the same behavior on the screen as well. 

 

Hello @jinin,

Thank you for your response.

It is not functioning as you stated. The "Commitment Nbr" selector will only load purchase orders by default. We need to change the Commitment type to subcontract to load these subcontract transactions.

Also, Have you enabled the construction module on features screen? 

I need to update subcontract nbr. from API. Any thoughts?

Thanks

 

Userlevel 7
Badge +4

@srikanth56

Try adding the POType field to the endpoint and include the field in the request payload as well. Below are the details for your reference,

GetFile.ashx?cache=yes&file=Email%20Activity%20(d21f5cb0-aa66-ed11-a9cf-ac1764631b07)\1.png

 

Sample payload,

{

    "RefNbr": {
        "value""000017"
    },
    "Class": {
        "value""EXTERNAL"
    },
    "COMMITMENTS": [
        {
            "ProjectTaskID": {
                "value""09"
            },
            "CostCode": {
                "value""09-680"
            },
            "InventoryID": {
                "value""CSTRMATS"
            },
            "Vendor": {
                "value""CORNERCONC"
            },
            "CommitmentType": {
                "value""Subcontract"
            },
            "POType": {
                "value""Subcontract"
            },
            "PONbr": {
                "value""SC-000001"
            },
            "POLineNbr": {
                "value"1
            },
            "Qty": {
                "value"5
            },
            "UnitCost": {
                "value"1750.00
            }
        }
    ]
}

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved