Kyle Johnson
Kyle Johnson

Reputation: 1675

SuiteScript - Search joining "Term" from "Vendor"

I am doing a search of vendors and want to join in the Term to have the Term's name. The vendor has a field called terms which has the internalid of the Term. Term has a field called name which contains what I'm looking for.

I've tried just about every combination of building the column but I always get an error:

An nlobjSearchColumn contains an invalid column join ID, or is not in proper syntax: name.

Example of how I'm building the column:

search.createColumn({
name: "name",
join: "terms", // or Term, or Terms, none of it works
label: "termname" // or leave this out or Term or Terms or anything else nothing works
}

What is the right way to create a search for vendor that also includes the term's name?

Upvotes: 0

Views: 460

Answers (1)

Jala
Jala

Reputation: 929

If you'll look at the Records Browser, terms is not listed as a join on the vendor record. Just get terms as a column (name: 'terms') then when you retrieve the result, use getText instead of getValue.

searchResults[i].getText({
    name: 'terms'
});

Upvotes: 1

Related Questions