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
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值