Skip to main content
Question

Issue with Time format on Work order

  • October 18, 2022
  • 4 replies
  • 115 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

Samuel Olivier Lavigueur
Acumatica Moderator
Forum|alt.badge.img+2

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


  • Author
  • Freshman I
  • October 21, 2022

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


  • Author
  • Freshman I
  • October 21, 2022

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?


greglang
Varsity I
Forum|alt.badge.img+1
  • Varsity I
  • April 3, 2023

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.