How to Create Custom Records with SuiteTalk

How to Create Custom Records with SuiteTalk

How to Create Custom Records with SuiteTalk

By on July 9, 2015

Sweet Talk on SuiteTalk & Custom Records

NetSuite documentation offers decent instructions on how to work with standard records via SuiteTalk. However, working with Custom Records is a bit trickier, and little documentation is available. A pretty common question from clients is, “How do I create a Custom Record with SuiteTalk?” So I thought I would include a simple C# example as this week’s post…

CustomRecord rec = new CustomRecord();

RecordRef recType = new RecordRef();
recType.internalId = “10”; // Internal ID of custom record type, not individual record id
recType.type = RecordType.customRecord;
recType.typeSpecified = true;
rec.recType = recType;

rec.name = “My new custom record”;

CustomFieldRef[] customFieldArray = new CustomFieldRef[1];

StringCustomFieldRef stringField = new StringCustomFieldRef();
stringField.scriptId = “custrecord_string”;
stringField.value = “A string”;
customFieldArray[0] = stringField;

rec.customFieldList = customFieldArray;

WriteResponse response = _service.add(rec);

I hope this is helpful to any one scouring the web trying to figure this out. For more information feel free to contact us at thoughtleader@keystonebusinessservices.net.

Kevin is responsible for driving the cloud-based technology vision for Keystone and its customers. In his role as Keystone’s lead technical expert, Kevin is deeply involved in most NetSuite and Salesforce.com implementation projects. Kevin’s expertise includes systems planning and analysis, custom application development, and cloud computing platform administration via Amazon Web Services. Prior to Keystone, Kevin held a variety of technical and functional roles throughout a diverse set of industries such as financial services, manufacturing, and advertising. Kevin holds an MBA from the Keller Graduate School of Management and a BS in Commerce from DePaul University.