SuiteTalk – Fetch Custom Columns – C# Example

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.

CustomFieldExample

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”
}
}
}
}
};

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s