Question

Issue with Time format on Work order

  • 18 October 2022
  • 4 replies
  • 78 views

We are passing work order time fields in api

 

getting error:

{

  "OrderNbr": {

    "value""W-222231"

  },

  "Labor": [

    {

      "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.Labor[0].ActualEndTime: The times are invalid. The end time cannot be earlier than the start time.\nWorkOrder.Labor[0].ActualStartTime: The start time cannot be later than the end time. Correct the values.\nWorkOrder.Labor[0].StartDate: The start time cannot be later than the end time. Correct the values.

 

Can anyone know what wrong with this?


4 replies

Userlevel 4
Badge +1

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.

 

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.Labor[0].ActualEndTime: The times are invalid. The end time cannot be earlier than the start time.\nWorkOrder.Labor[0].ActualStartTime: The start time cannot be later than the end time. Correct the values.\nWorkOrder.Labor[0].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": [

    {

      "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?

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

Userlevel 3
Badge +2

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

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