Discussions
Creating a WorkOrder Flow Questions
Hello!
We are close to having all the information needed to create a WorkOrder from our software, but I have a few questions.
In the Simple Work Order Create recipe, the fourth step is to query model by model number. What exactly is model number? I am assuming it is not the ID of the model because by this step I would need to query for models to select from for the work order. Also, at least with the staging data, all the models I queried do not have a number.
How do I know the TypeCategory for the WorkOrder? I could not seem to find the enum anywhere in the documentation.
Along with TypeCategory, the recipe suggests querying for SubType by using “Request” as a parameter. Whenever I do this, I just receive a WorkOrderType of “Request” also. Is this correct?
I was not able to create a WorkOrder using a ContactId like the documentation suggested (WoCreateCommand1), the only way I was able to successfully create a WorkOrder was using the ContactID, ContactName, and ContactAddress. Is this correct?
The current process we are following to get all the information needed to create a WorkOrder is this:
- Authorize
- Get endpoint URL
- Query Customer List – store selected customer ID and workzone asset ID
- Query Models – store selected model ID
- Query Assets using Model ID and WorkZone Asset ID – store selected asset ID
- Query Tasks using Model ID (Did not seem to need task code) – store selected task ID
- Query WorkOrderType to get subtype – store selected subtype ID
- Query Contacts – store selected ID, ContactName, and ContactAddress
- Submit the WorkOrder:
{
"Command":
{
"WorkOrder": {
"Items": [
{
"Asset": {
"Id": "ASSET ID HERE (step 5)"
},
"Task": {
"Id": "TASK ID HERE (step 6)"
},
"Comment": "Include Notes Here"
}
],
"ContactId": 36,
"ContactName": "CONTACT NAME",
"ContactAddress": {
"AddrTypeId": "Contact",
"Address": "ADDRESS/PHONE"
},
"TypeCategory": 4 (question above),
"SubType": {
"Id": 259 (question above)
},
"Customer": {
"Id": "42"
}
},
"ComputeSchedule": true
},
"RequestId": "TASK_ID (ID to identify WorkOrder from our software)"
}
Thanks for any assistance!