Function to create contacts in Netsuite using Suitelets

function createContact(firstname,lastname,email,phone,mrms,company,Newsletter){
    var obj = nlapiCreateRecord('contact',{recordmode: 'dynamic'});
    obj.setFieldValue('firstname', firstname +' '+ lastname);
    obj.setFieldValue('phone', phone);
    obj.setFieldValue('company', company);
    obj.setFieldValue('subsidiary', 1);
    obj.setFieldValue('email', email);
    if(Newsletter =='on'){
        obj.setFieldValue('globalsubscriptionstatus', 1);
        obj.setFieldValue('globalsubscriptionstatus', 2);
    var id= nlapiSubmitRecord(obj);
    return id;
Labels: , ,

Popular posts from this blog

Sort an array of 0s, 1s and 2s solution in javascript

Contact Me


Email *

Message *