Discussions
How can I update a WorkOrder.Assignment?
8 days ago by Jose Reynoso
How can update a work orders assignment? I need to update the work orders assignment to a different employeeId.
I've tried using the WOAssignment
command from here
var entity = new WoAssignment
{
Id = workOrder.Assignments[0].Id,
EmployeeId = Corrigo.WksFacilitiesUserId,
};
I receive the following error.
modifications must be performed in parent's context; parent ID #213424
I tried updating the entire work order
var command = new UpdateCommand
{
Entity = workOrder,
PropertySet = new PropertySet { Properties = ["Assignments.EmployeeId"] },
};
I receive the following error:
WorkOrder.Assignments property can't be updated.
Do I need to delete wo assignment and then add a new one?