Question
Where is LocationID field we see in our error message, and how can we stop it being empty?
Overview
Our system attempts to create Appointments for Service Orders via the Acumatica API. We are having a lot of trouble with the error:
LocationID' cannot be empty.; LocationID: 'LocationID' cannot be empty.
This error occurs in the API only, we do not see the error when creating appointments using the UI.
Our software uses the API tries to take an existing Service Order, add an Appointment for it, and then set the Scheduled and Actual dates/times on the new appointment. The ultimate goal is to enter an appointment log and create time cards automatically. The error occurs when we try and set the dates and times.
Technical Detail
The working request to create the appointment looks like:
{
"ServiceOrderNbr": {
"value": "40054"
},
"ServiceOrderType": {
"value": "TECH"
},
"BranchLocation": {
"value": "DVM"
},
"Customer": {
"value": "CSOUTHPAC"
}
}Which is mapped to the following fields in our custom endpoint:
ServiceOrderNbrAppointmentRecords > Service Order Nbr.ServiceOrderTypeAppointmentRecords > Service Order TypeCustomerAppointmentRecords > Customer
The failing request to set the dates and times looks like :
{
"AppointmentNbr": {
"value": "40083-4"
},
"ServiceOrderLocation": {
"value": "MAIN"
},
"ScheduledStartDate": {
"value": "2024-03-06T00:00:00.000Z"
},
"ScheduledEndDate": {
"value": "2024-03-06T00:06:00.000Z"
},
"ActualStartDate": {
"value": "2024-03-06T00:00:00.000Z"
},
"ActualEndDate": {
"value": "2024-03-06T00:06:00.000Z"
},
"ScheduledStartTime": {
"value": "2024-03-06T00:00:00.000Z"
},
"ScheduledEndTime": {
"value": "2024-03-06T00:06:00.000Z"
},
"ActualStartTime": {
"value": "2024-03-06T00:00:00.000Z"
},
"ActualEndTime": {
"value": "2024-03-06T00:06:00.000Z"
}
}Which is mapped to the following fields in our custom endpoint:
AppointmentNbrAppointmentRecords > CustomerServiceOrderLocationService Order Header > Location > LocationID (This was set up as a failed attempt to fix the bug)Actual Dates and TimesSettings > Appointment Times > Actual Date And TimeScheduled Dates and TimesService Order Header > Delivery Notes