Skip to main content

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.Commitmentsm0].PONbr: Commitment Nbr. 'SC-000001' cannot be found in the system.

Acumatica version: 21.217.0035

 

Thanks

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

 


@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": l
        {
            "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