简体   繁体   English

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

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

The following is the script that I write for writing back " ship from location" information to Item Fulfillment for a certain customer.以下是我为某个客户将“从位置发货”信息写回项目履行而编写的脚本。 But it's not working.但它不起作用。

Anyone see a syntax error, know what I might be missing, or what I can test for?任何人都看到语法错误,知道我可能遗漏了什么,或者我可以测试什么?

    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;

You stated that the code doesn't work.您说代码不起作用。 Is there a specific error, as someone asked?正如有人问的那样,是否存在特定错误? Does the search bring back results or is it an issue in the search itself?搜索会带回结果还是搜索本身的问题? Did you add any debug code in your script to see if you can pinpoint where the issue may be?您是否在脚本中添加了任何调试代码以查看是否可以查明问题所在?

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

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