im trying to mass-create work order via map/reduce...
# suitescript
s
im trying to mass-create work order via map/reduce is this correct way to to set the values ?
Copy code
var workorder = record.create({
      type: record.Type.WORK_ORDER,
      defaultValues: {
        subsidiary: 2,
      },
      //
    });

    workorder.setValue({ fieldId: "assemblyitem", value: id });
    workorder.setValue({ fieldId: "quantity", value: qty });
e
are u able to test this one on or two test Work Orders?
s
Via ui yes not script
e
not sure you need subsidiary in the defaultValues or just setValue
the above worked for me (with one additional line):
workorder.save({ ignoreMandatoryFields: true });
s
I slept on this and realized I can skip the whole work order and just build the assembly which is back-ordered