You would require to upload the file in the NS file cabinet first and then attach it to the record using this API call nlapiAttachRecord(type, id, type2, id2, attributes). Pls see example below:
var type = ‘file’; // the record type for the record being attached
var id = 297; // the internal ID of an existing jpeg in the file cabinet
var type2 = ‘customer’; // the record type for the record being attached to
var id2 = 406; // this is the internal ID for the customer
var attributes = null;
nlapiAttachRecord(type, id, type2, id2, attributes)
I just wanted to get the internal IDs of the attached files under the Files tab. Already resolved the problem . Appreciate your sample though. Thank you!