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 badges1 Answer
Reset to default 8When 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"
});