NetSuite2.0 Restlet脚本 货品新增

/**

  • @NApiVersion 2.x
  • @NScriptType Restlet

*/
define([‘N/log’, ‘N/record’],
function (log, record) {

 function post(params) {
     log.debug('参数', params)
    var recordObj = record.create({
        type: record.Type.INVENTORY_ITEM,
        isDynamic: true
    });
	
	recordObj.setText({
        fieldId: 'itemid',
        text: params.code,
    });
	recordObj.setText({
        fieldId: 'custitem_k_parent_sku',
        text: params.spuCode,
    });
	recordObj.setText({
        fieldId: 'displayname',
        text: params.name,
    });
	recordObj.setText({
        fieldId: 'custitem_14k_price',
        text: params.price,
    });
	//面料型号
	recordObj.setText({
        fieldId: 'custitem_k_fabric_sku',
        text: params.shellFabricModel,
    });
	//面料用量
	recordObj.setText({
        fieldId: 'custitem_k_fabric_dosage',
        text: params.shellFabricQty,
    });
	//成分
	recordObj.setText({
        fieldId: 'custitem_k_fabric_content',
        text: params.composition,
    });
	//毛重
	recordObj.setText({
        fieldId: 'custitem_k_weight',
        text: params.packWeight,
    });
	//单个体积汇总
	recordObj.setText({
        fieldId: 'custitem_k_cbm',
        text: params.packSkuVolume,
    });
	//单个sku包装数
	recordObj.setText({
        fieldId: 'custitem_k_individual',
        text: params.packSkuNum,   
    });
	//包装体积
	recordObj.setText({
        fieldId: 'custitem_k_1cbm',
        text: params.packVolume,
    });
    //SCM 运营方式为自营
    recordObj.setValue({
        fieldId: 'custitem_k_agent_operation',
        value: 1,
    });
   //是否包括附属公司 true false   
	recordObj.setValue({
        fieldId: 'includechildren',
        value: true,
    });
	//产品类型 SCM产品类型写死为家具
	recordObj.setValue({
        fieldId: 'custitem_k_sku_leixing',
        value: 1,
    });
   
   //采购/库存 追踪到岸成本 追踪到岸成本写死true
	recordObj.setValue({
        fieldId: 'tracklandedcost',
        value: true,
    });
   
   
   

    // 保存
    var recordId = recordObj.save({
        enableSourcing: true,
        ignoreMandatoryFields: true
    });
    return recordId;
 }

 return {
     post: post
 };

});

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
WebStorm是一个开发工具,提供了许多功能和插件,但是它并不直接支持Netsuite的安装。要在WebStorm中使用Netsuite,您需要使用Netsuite SuiteScript SDK插件和相关的开发工具。 以下是一些步骤,可以帮助您在WebStorm中安装和使用Netsuite: 1. 安装WebStorm:首先,您需要在计算机上安装WebStorm。您可以从官方网站(https://www.jetbrains.com/webstorm/)下载并安装最新版本的WebStorm。 2. 安装Netsuite SuiteScript SDK插件:在WebStorm中,您需要安装Netsuite SuiteScript SDK插件。您可以打开WebStorm,并选择“File”>“Settings”>“Plugins”。在“Plugins”窗口中,搜索“Netsuite SuiteScript SDK”,然后安装该插件。 3. 配置Netsuite SuiteScript SDK插件:安装插件之后,您需要配置它。选择“File”>“Settings”>“Other Settings”>“Netsuite SuiteScript SDK”。在这里,您需要输入Netsuite的登录信息和相关的开发设置。 4. 创建一个新项目:在WebStorm中,您可以创建一个新项目,以开始使用Netsuite。选择“File”>“New Project”,然后选择“Netsuite”模板。在这里,您可以定义项目的名称和路径。 5. 编写代码:在WebStorm中,您可以编写Netsuite的代码。使用Netsuite SuiteScript SDK插件,您可以访问Netsuite的API,并编写自己的脚本。 6. 运行代码:在WebStorm中,您可以运行您的Netsuite脚本。使用Netsuite SuiteScript SDK插件,您可以将脚本上传到Netsuite,并在应用程序中运行它。 这些是在WebStorm中安装和使用Netsuite的一些步骤。使用这些步骤,您可以开始使用Netsuite,并使用WebStorm进行开发。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值