Hello, I am looking for code in SC 2.0 to create a...
# suitescript
h
Hello, I am looking for code in SC 2.0 to create a vendor record. Can anyone help me with it?
n
Copy code
var objRecord = record.create({
    type: record.Type.VENDOR,
    isDynamic: true    
});
h
Thank you.
n
don't forget to save it after setting all your field values 😉
h
Yes! objRecord.save() . Also I can get the internal ID of the record by doing something like objRecord.internalid?
r
You'll need to save it first before 'reloading' for the internal ID.
s
record.save() returns the internalid, you do not need to reload the record
👍 1
h
Thanks a lot!