Hey guys, I'm trying to use SS2 to import Sales Or...
# suitescript
s
Hey guys, I'm trying to use SS2 to import Sales Orders, so I want the tranid to be custom, but when I try setting the field, it gets ignored and the document number is autogenerated. How do I make it use my tranid instead? Or is there a better field for me to put the imported order number in?
o
There's a checkbox on the form called autoname I think that you need to set to false in your script to be able to set the tranid
workerRec.setValue({ fieldId: 'autoname', value: false })
s
That didn't work, I tried setting that value on the record and then setting the tranid and it still ended up with an autogenerated one.
o
I've found I have to set that in the script before I can update the tranid. I just point to it on the form so you can see it and verify the field internalid
So var newRec = record.create(...) newRec .setValue('autoname' , false) newRec .setValue('tranid', xxxx)
There's also a netsuite system setting in Setup->Company->Auto Generated Numbers you may need to disable
s
Yes thats exactly what I tried: var newSO = record.create({ type: record.Type.SALES_ORDER, isDynamic: true }); newSO.setValue({ fieldId: 'autoname', value: false }); newSO.setValue({ fieldId: 'tranId', value: tranid });
not to mention, there is no autoname field listed in the record documentation browser here: http://www.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2016_1/schema/record/salesorder.html
o
Ah sorry I was crossing entities and transactions. Go to Setup->Company->Auto-Generated Numbers and check allow override for sales orders on the document numbers tab