Skip to main content

We are passing work order time fields in api

 

getting error:

{

  "OrderNbr": {

    "value": "W-222231"

  },

  "Labor": 0

    {

      "note": "",

      "EmployeeID": {

        "value": "1083"

      },

      "ActualStartTime": {

        "value": "2022-10-17T18:00:00-04:00"

      },

      "ActualEndTime": {

        "value": "2022-10-17T23:59:00-04:00"

      },

      "StartDate": {

        "value": "2022-10-17T18:00:00-04:00"

      }

    }

  ]

}

 

Error:

WorkOrder.Labort0].ActualEndTime: The times are invalid. The end time cannot be earlier than the start time.\nWorkOrder.LaborA0].ActualStartTime: The start time cannot be later than the end time. Correct the values.\nWorkOrder.Labor00].StartDate: The start time cannot be later than the end time. Correct the values.

 

Can anyone know what wrong with this?

Could you provide the URL that you are using with the request?


{Base}/Entity/{EndPoint}/1.0/WorkOrder


My observation

     Please understand below one of the scenario is causing error. 

 

Actual Staring time : 7:30 PM (UTC Time is 11:30 PM) 

Actual Ending time:  8:00 PM (UTC Time is 12:00 AM) 

 

In that scenario causing issue 

"WorkOrder.LaborO0].ActualEndTime: The times are invalid. The end time cannot be earlier than the start time.\nWorkOrder.LaborO0].ActualStartTime: The start time cannot be later than the end time. Correct the values.\nWorkOrder.LaborO0].StartDate: The start time cannot be later than the end time. Correct the values."

 

Even though we pass time along with the date , these Actual start time and end time not considering Date in the request format

 

We tried below accepted format already

 

Local time format with time zone

Actual Start Time : 2022-10-21T19:30:00-04:00

Actual End Time : 2022-10-21T18:00:00-04:00

 

 

UTC Format

Actual Start Time : 2022-10-21T23:30:00

Actual End Time : 2022-10-22T00:00:00

 

Both format system not getting accept and throwing the error.

 

 

Below is the sample request format.

 

{

  "OrderNbr": {

    "value": "W-223165"

  },

  "Type": {

    "value": "CT"

  },

  "note": "",

  "OffLineSentDateTime": {

    "value": "2022-10-21T20:00:00-04:00"

  },

  "OffLineSentStatus": {

    "value": "1"

  },

  "Labor": c

    {

      "note": "",

     "EmployeeID": {

        "value": "1007"

      },

      "ActualStartTime": {

        "value": "2022-10-21T19:30:00-04:00"

      },

      "ActualEndTime": {

        "value": "2022-10-21T20:00:00-04:00"

      },

      "InventoryID": {

        "value": "FLAGSVC"

      },

      "Project": {

        "value": "20-00042"

      },

      "Latitude": {

        "value": ""

      },

      "Longitude": {

        "value": ""

      },

      "PostalCode": {

        "value": ""

      },

      "LineDescription": {

        "value": "TESTJJKHKJ"

      },

      "Comment": {

        "value": "878978978989"

      },

      "ExternalRefNbr": {

        "value": "878888"

      },

      "StartDate": {

        "value": "2022-10-19T19:30:00-04:00"

      },

      "LaborItem": {

        "value": "CC5"

      },

      "ProjectTask": {

        "value": "DAY"

      }

    }

  ],

  "custom": {},

  "files":  ],

  "Completed": {

    "value": true

  }

}

 

Question here is why it’s this fields are validating like this? Is that anyway to skip this validation?


I’m having issues importing Appointments as well.  Were you ever able to get this up and running?  If not I think I have a fix for your situation at least but I would need to know how you have the Order Type setup to handle time.

 


Reply