您可以将 id 字段设为 Netsuite 中的外部 id 吗?

Can you make the id field the external id in Netsuite?

我在 netsuite 对象上有 id 字段。我可以更改使用 id 列作为 Netsuite 中的外部 ID,就像在 Salesforce 中一样吗?

  • 您绝对可以编写一个用户事件脚本来将任何记录的内部 ID 填充到它的外部 ID 字段。 “externalid”字段通过 SuiteScript 或通过 csv import

    公开
  • 内部 id 是一个唯一的自动生成的数字,它标识一个唯一的 NetSuite 记录,因此如果 deletion/inactivation 发生,序列将会改变对于 eg.if 有内部记录系统中的 ID 1、2 和 3,2 被删除,然后系统中保留的 ID 为 1 和 3。用户无法更改这些内部 ID,因为它们是系统生成的。因此,如果你想遵循特定的约定,它们不能定制(根据开发人员的偏好)。

  • 外部 ID 应包含一个值,该值在多个集成 systems.Eg 中应该是唯一的。 SFDC(销售人员)。推荐的方法是编写一个提交用户事件脚本来填充所有集成记录的外部 ID 并在两个系统中保持同步

这是 SuiteScript 2.0 中的示例代码,它填充了子公司、客户和部门的外部 ID:

var recordType = context.newRecord.type;
            log.debug({ title: 'Record Type', details: recordType })
        
            var recordId = context.newRecord.id;
            log.debug({ title: 'Record ID', details: recordId })
        
            var rec = record.load({
                                    type: recordType,
                                    id: recordId
                                });
                                
            //Setting External ID on subsidiary
            if (recordType == record.Type.SUBSIDIARY) 
               {
            var subExID 
         =rec.setValue('externalid'(rec.getValue('tranprefix').substring(0, 3)))
                log.debug({ title: 'TranPrefix', details: subExID })
                }
        
            //Setting External ID on account
            if (recordType == record.Type.ACCOUNT) 
            {
            var accExID = rec.setValue('externalid', 
     rec.getValue('acctnumber'))
            log.debug({ title: 'External ID', details: accExID })
                                }
        
            //Setting External ID on department
            if (recordType == record.Type.DEPARTMENT) 
            {
            var deptExID = rec.setValue('externalid', rec.getValue('custrecord_dept_code'))
            log.debug({ title: 'External ID', details: deptExID })
            }
    
    

如果有帮助请告诉我!!!