最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - NetSuite GetValue does not work for join column - Stack Overflow

programmeradmin3浏览0评论

I am trying to get a column value for the join table through SuiteScript. It does not throw error but it dont show the result either. Any tweak or tips to get the value.

var vendorSearchObj = search.create({
    type: "vendor",
    filters: [
       [["entityid" , "is" , "KMSS"]]
    ],
    columns: [
       search.createColumn({
          name: "entityid",
          sort: search.Sort.ASC
       }),
       "altemail",
       search.createColumn({
          name: "salutation",
          join: "contact"
       })
    ]
 });
 var searchResultCount = vendorSearchObj.runPaged().count;
 vendorSearchObj.run().each(function(result){
    // .run().each has a limit of 4,000 results
     log.debug("result", result);
     for (i = 0; i < 3 ; i++) {
        log.debug(result.columns[i].name,result.getValue({name : result.columns[i].name}));
    } 
    return true;
 });

All the value is ing except the salutation column. But in result set the value is available. Below is the resultset value.

{
   recordType: "vendor",
   id: "375",
   values: {
      entityid: "KMBS",
      altemail: "",
      "contact.salutation": "Konica Jag"
   }
}

TIA...

I am trying to get a column value for the join table through SuiteScript. It does not throw error but it dont show the result either. Any tweak or tips to get the value.

var vendorSearchObj = search.create({
    type: "vendor",
    filters: [
       [["entityid" , "is" , "KMSS"]]
    ],
    columns: [
       search.createColumn({
          name: "entityid",
          sort: search.Sort.ASC
       }),
       "altemail",
       search.createColumn({
          name: "salutation",
          join: "contact"
       })
    ]
 });
 var searchResultCount = vendorSearchObj.runPaged().count;
 vendorSearchObj.run().each(function(result){
    // .run().each has a limit of 4,000 results
     log.debug("result", result);
     for (i = 0; i < 3 ; i++) {
        log.debug(result.columns[i].name,result.getValue({name : result.columns[i].name}));
    } 
    return true;
 });

All the value is ing except the salutation column. But in result set the value is available. Below is the resultset value.

{
   recordType: "vendor",
   id: "375",
   values: {
      entityid: "KMBS",
      altemail: "",
      "contact.salutation": "Konica Jag"
   }
}

TIA...

Share Improve this question asked Jul 21, 2017 at 13:52 ArindamArindam 72310 silver badges19 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

When you want the value from a join column, you need to specify the join property of getValue as well.

result.getValue({
    name: "salutation",
    join: "contact"
});
发布评论

评论列表(0)

  1. 暂无评论