Hopefully a quick question, I am trying to write a script that creates a po from a sales order. I have the below two lines (amongst others) that should create a new record and then set the created from field. I don't get an error on execution but the record is created accept the created from field is empty and not shown in the form, is there anyway I can populate this field? Do I need to create the record in a different way?
var sstranid = nlapiGetRecordId() //Sales Order Number
var newpo = nlapiCreateRecord('purchaseorder')
newpo.setFieldValue('createdfrom',sstranid)
Thanks in advance