Skip to main content
Solved

Update Commitment details in change orders from REST API

  • November 14, 2022
  • 3 replies
  • 297 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

Best answer by Vignesh Ponnusamy

@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
            }
        }
    ]
}
View original
Did this topic help you find an answer to your question?

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 706 replies
  • November 15, 2022

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. 

 


  • Author
  • Freshman I
  • 8 replies
  • November 15, 2022

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

 


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

@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


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