Solved

Error adding an Appointment Through Postman PUT call

  • 28 November 2023
  • 8 replies
  • 120 views

Userlevel 2
Badge

Hi Community,

I’m trying to add an appointment though PUT from Postman and I’m getting this error where it is saying that the “CustomerID: 'Customer' cannot be empty.; BillingBy: 'Billing By' cannot be empty.” but I have added these fields in the insert record. I’m not sure what this means am Imissing any fields or the query is wrong.
This is an example with dummy data.

Please let me know if i’m missing any steps 
Thanks in advance.

icon

Best answer by jinin 28 November 2023, 13:03

View original

8 replies

Userlevel 7
Badge +11

Hi @DineshJ ,

Your JSON request is incorrect. It appears you are using the Push notification message as the JSON request.

Please make a GET call to retrieve the JSON response for an appointment, and utilize that JSON response as the request for the insert/update operation using a POST call.

Sample Request JSON:

{
    "AppointmentNbr": {
        "value": "AP0005"
    },
    "ScheduledStartDate": {
        "value": "2023-11-28"
    },
    "ServiceOrderNbr": {
        "value": "SO987987"
    },
    "Customer": {
        "value": "030072989"
    },
    "Location": {
        "value": "MAIN"
    }
}

Userlevel 2
Badge

Thank you @jinin,  I tried with the Json format before but I might have missed formating, as it was not working I tried with the Push notification Message. But now I recheched the Json and now it works fine. 
Thank you for quick reply.
 

Userlevel 2
Badge

So Now I’m trying to update the Description in the Details section but it is not updating the line instead creating a new line.

 

{

    "AppointmentNbr": {

        "value": "ABCD000374-1"

    },

    "ProblemDescription": {

        "value": "update test with postman with out cust"

    },

    "ServiceOrderType": {

        "value": "ABCD"

    },

    "Details": [

        {

            "rowNumber": 1,

            "LineNbr": {

                "value": 1

            },

            "LineType": {

                "value": "Service"

            },

            "InventoryID": {

                "value": "S.SERVI"

            },

            "Description": {

                "value": "ttt"

            },

            "LineRef": {

                "value": "0001"

            }

        }

    ]

}

I have tried with the LineRef, LineType, LineNbr but still creating a new how I can update existing line.

 

 

Userlevel 7
Badge +11

Hi @DineshJ ,

The LineNbr field is sufficient to update the detail section. I've confirmed its functionality on the Sales Order screen, and it's working as expected. Currently, the Field Service module is not enabled in my system, so unable to review the Appointment screen.

Userlevel 7
Badge +4

Hi @DineshJ,

Ideally, it will be a two step process,

  • Do a GET request, expand the details section which will give the ID of the each detail line
  • In the PUT request, use the ID of the detail line and update the field for that specific detail line

Following documentation has an example with Sales Order,

https://help.acumatica.com/(W(2))/Help?ScreenId=ShowWiki&pageid=a91733a5-2f47-435d-b4c9-c08282630532

Thanks,

Userlevel 2
Badge

Great Thanks @Vignesh Ponnusamy that works as expected, but the return Json responce does not have all the line items added thorugh PUT or from Acumatica. the Json is only returning the 1st row from the Details. Is this expected or there is something wrong with my process?

Userlevel 2
Badge

Sorry @jinin I tried with lineNbr for several time but it is not working I used the id(NoteID) which is uique for each line this worked for the updating the record, but when I add any line item in Appointment Details through Acumatica by selecting LineType and InventoryID the EstimatedQuantity and BillableQuantity are auto filled with value 1.00. But when I try to a new Lineitem through Postman PUT call with or without an value in the fields EstimatedQuantity(EstimatedQty) and BillableQuantity(BillableQty) are always showing 0.00. they are not updating as per the input provided in Postman call.
 

for the same LineType and InventoryID line: 3 added through acumatica has value 1,  lines: 4-6 added through Postman by adding as a string, inter and single quotes decimal values but still 0.00. 

Userlevel 7
Badge +4

Hi @DineshJ,

All the detail lines should be fetched, when you do $expand=Details in the PUT request.

Are you using the default endpoint or the custom extended one? Can you share more details of your setup and the API call? Thanks, 

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