繁体   English   中英

Suitescript:无法从搜索中获取结果

[英]Suitescript: Can't Get Result From Search

以下是我为某个客户将“从位置发货”信息写回项目履行而编写的脚本。 但它不起作用。

任何人都看到语法错误,知道我可能遗漏了什么,或者我可以测试什么?

    case "2946":
        var warehousecode = WH_Code_Lookup(customer , location);
        itemfulfillment.setFieldValue('custbody_warehouse_code', warehousecode);// set warehouse code

        // Set Ship from location
        var columns = [];
        columns[0] = new nlobjSearchColumn('address1');
        columns[1] = new nlobjSearchColumn('address2');
        columns[2] = new nlobjSearchColumn('city');
        columns[3] = new nlobjSearchColumn('state');
        columns[4] = new nlobjSearchColumn('country');
        columns[5] = new nlobjSearchColumn('zip');

        var search = nlapiSearchRecord('location', null, new nlobjSearchFilter('internalid', null, 'is', invCheckFlag), columns);

        itemfulfillment.setFieldValue('custbodyship_from_address1', search[0].getValue('address1'));
        itemfulfillment.setFieldValue('custbodyship_from_address2', search[0].getValue('address2'));
        itemfulfillment.setFieldValue('custbodyship_from_city', search[0].getValue('city'));
        itemfulfillment.setFieldValue('custbodyship_from_country', search[0].getValue('country'));
        itemfulfillment.setFieldValue('custbodyship_from_state', search[0].getValue('state'));
        itemfulfillment.setFieldValue('custbodyship_from_postal_code', search[0].getValue('zip'));

        if(location == 6){
            itemfulfillment.setFieldValue('thirdpartyacctups',edi_customer_search[0].getValue('custrecord_2nd_3rd_pty_ups'));
            itemfulfillment.setFieldValue('thirdpartyzipcodeups',edi_customer_search[0].getValue('custrecord_2nd_3rd_pty_ups_zip'));
            itemfulfillment.setFieldValue('thirdpartytypeups','BILLTHIRDPARTY');
        }
        break;

您说代码不起作用。 正如有人问的那样,是否存在特定错误? 搜索会带回结果还是搜索本身的问题? 您是否在脚本中添加了任何调试代码以查看是否可以查明问题所在?

暂无
暂无

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

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