SuiteAnswers has an article with sample code that fetches custom columns from a SuiteTalk advanced search request. Although it works, it was very difficult to decipher. After some review, I simplified.
Here’s a link to the original SuiteAnswers article: #21674
Here is a picture of the simplified code in Visual Studio. It’s a lot easier to read when it’s formatted.
The key to fetching custom columns is telling the customFieldList which custom fields you wish to retrieve.
Here is the code in case you want to cut and past it into your project.Â
TransactionSearchAdvanced advanced = new TransactionSearchAdvanced()
{
columns = new TransactionSearchRow()
{
basic = new TransactionSearchRowBasic()
{
internalId = new SearchColumnSelectField[] { new SearchColumnSelectField() }
,
tranId = new SearchColumnStringField[] { new SearchColumnStringField() }
,
tranDate = new SearchColumnDateField[] { new SearchColumnDateField() }
,
customFieldList = new SearchColumnCustomField[] {
new SearchColumnSelectCustomField() {
scriptId = “custbody_example_listrecord”
}
,
new SearchColumnStringCustomField() {
scriptId = “custbody_example_free_form_text”
}
}
}
}
};