如何在C#中使用Suitetalk在netesuit中创建自定义记录?

时间:2015-01-13 04:18:51

标签: c#-4.0 netsuite

如何通过C#中的Suitetalk在netsuite中创建自定义记录?

1 个答案:

答案 0 :(得分:2)

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);