I'm using transform to create a Credit Memo from R...
# suitescript
s
I'm using transform to create a Credit Memo from Return Authorization. It's working but I have to specify a form id and I have to pass the mandatory fields of the form. I have many forms all with different mandatory fields. Is there's a way to say transform regardless of the Form ?
r
Do you want to transform the credit memo from RMA and ignore mandatory fields?
if yes, you can use following cmds. var creditMemo = nlapiTransformRecord('returnauthorization', id, 'creditmemo'); var creditmemoId = nlapiSubmitRecord(creditMemo, false,true);
//nlapiSubmitRecord(record, doSourcing, ignoreMandatoryFields)
s
I'm sure you are right but in 2.0 it needs the form
for example
Copy code
var invRec = record.transform({
    fromType: record.Type.CUSTOMER,
    fromId: custId,
    toType: record.Type.INVOICE,
    isDynamic: true,
    defaultValues: {customform:296}
});
b
thats pretty strange
defaultValues are optional