While not documented in NetSuite’s help page, the user group has come through. During a Magento integration project, we needed to create and update user accounts through our custom Restlet (note, it is much easier to program PHP against Restlets versus NetSuite Web Services). We became a bit nervous as NetSuite’s Records Browser didn’t share that passwords were available for update.
SuiteScript to Update Passwords
The following code pattern should be familiar to SuiteScript developers. While fairly obvious, when capacities are not documented, it’s easy to become concerned.
customer.setFieldValue('accessrole', role_id); customer.setFieldValue('pass' +'word', password); // not documented; break into two parts to fool the customer.setFieldValue('pass' +'word2', password); // IDE to not complain that field isn't supported. customer.setFieldValue(' giveaccess', 'T'); customer.setFieldValue(' sendemail', 'F');
Get Help
If you want to automate or integrate your system to NetSuite, contact us.
This does not seem to work for updating the password of a contact – do you know of a workaround to update their password?
Hello Matt,
I believe the only way to update the password on contact records is via the customer / vendor / employee entity equivalents. I may be mistaken however and invite others to comment.
Marty
To set or update the passwords for contacts of a customer/company you do it via the “contactroles” sublist on the customer/company record.
company.selectLineItem('contactroles',i);
company.setCurrentLineItemValue('contactroles','giveaccess','T');
company.setCurrentLineItemValue('contactroles','fillpassword','T');
company.setCurrentLineItemValue('contactroles','password','TEST1234!');
company.setCurrentLineItemValue('contactroles','passwordconfirm','TEST1234!');
company.commitLineItem('contactroles');
Scott,
Thank you. This is helpful.
Marty