简体   繁体   English

使用自定义细分字段为现金销售节省价值

[英]Save value for a Cash sale with a custom segment field

I'm trying to save a cash sale in netsuite, we have a custom segment field called business unit (ScriptId = custbody_cseg2) and I need to put an specific value to it (Internal Id = 2 in the custom segment). 我试图在Netsuite中保存现金出售,我们有一个名为业务单位的自定义细分字段(ScriptId = custbody_cseg2),我需要为其指定一个特定值(自定义细分中的内部ID = 2)。

I'm using the following code who is pretty much the same we have in the netsuite's help but applied to a cash sale transaction: 我正在使用以下代码,这些代码与网络套件帮助中的代码几乎相同,但适用于现金出售交易:

SelectCustomFieldRef selectCustomFieldRef = new SelectCustomFieldRef();
ListOrRecordRef custSelectValue = new ListOrRecordRef();
custSelectValue.internalId = "2";
//custSelectValue.typeId = "286"; <- with or whitout doesn't change
selectCustomFieldRef.value = custSelectValue;
selectCustomFieldRef.scriptId = "custbody_cseg2";
CustomFieldRef[] customFieldRefArray = new CustomFieldRef[1];
customFieldRefArray[0] = selectCustomFieldRef;
cashSale.customFieldList = customFieldRefArray;

When I run this code I get the following error: 当我运行此代码时,出现以下错误:

[Code=INSUFFICIENT_PERMISSION] You do not have permissions to set a value for element custbody_cseg2 due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases.

Do anyone know what would be the error? 有人知道这是什么错误吗?

Thank you very much! 非常感谢你!

As its a custom field, check the access level of the field in the custom field creation form. 作为其自定义字段,请在自定义字段创建表单中检查该字段的访问级别。 May be you don't have sufficient privilege to edit this field. 可能是您没有足够的权限来编辑此字段。

This might be related to your role permissions. 这可能与您的角色权限有关。

On NetSuite, go to Setup => Users/Roles => Manage Roles. 在NetSuite上,转到设置=>用户/角色=>管理角色。 Select the role you are using to access NetSuite through Web Services. 选择用于通过Web服务访问NetSuite的角色。 Under the Permissions tab, select the "Transactions" subtab and add "Cash Sale". 在“权限”选项卡下,选择“交易”子选项卡,然后添加“现金销售”。 See below image: 见下图: 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM