why is this: ```function closeWorkOrder(workOrder...
# general
j
why is this:
Copy code
function closeWorkOrder(workOrderId) {
        try {
            let workOrder = record.load({ type: 'workorder', id: workOrderId });
            workOrder.setValue({ fieldId: 'orderstatus', value: 'H' }); 
            workOrder.save();
        } catch (e) {
            log.error('Error Closing Work Order', {
                workOrderId: workOrderId,
                error: e.message,
                stack: e.stack 
            });
        }
    }
giving me this error: "You cannot close this work order by setting work order status directly." i understand what its telling me but i don't believe it i'm just using work orders, no WIP or anything like that. Just doesn't make sense to me
c
Closing is to create a transaction not a simple status change