I have a small application that iterates over the results of a "Saved Search" retrieving the values from several Custom Columns(simplified example):
var results = searchResults.Select(a => new
{
X = ((SearchColumnBooleanCustomField)a.basic.customFieldList
.First(b => b.scriptId == "custentityX")).searchValue
Y = ((SearchColumnDateCustomField)a.basic.customFieldList
.First(b => b.scriptId == "custentityY")).searchValue
Z = ((SearchColumnSelectCustomField)a.basic.customFieldList
.First(b => b.scriptId == "custentityZ")).searchValue.name
}
For most returned column types I get a value consistent with the type(bool/date/etc...) but with the "SearchColumnSelectCustomField" I don't get any value in the returned "searchValue.name", it's always null, however the "searchValue.internalID" column is always populated. So for some reason its getting the selection but not returning the value from that selection.
How do I access the text value that I can see from the NetSuite interface from SuiteTalk("searchValue.name")? Do I have to execute another query to retrieve all value key pairs related to that internalID? For every custom field? And if so then what is the purpose of the name field in the first place?
I've tried searching around for this, but there's not really allot of documentation on the subject(or on SuiteTalk in general), in other languages(PHP/Java) people mention "getSelectValue"(here, and briefly here), I could try this in C#, but I'm not sure if these apply or if that can be done for custom value selections. Then there's some references for determining the values BEFORE the search, this seems like overkill to me, is it really that hard? I have dozens of CustomFields I would like to access in my final application. Seems like there should be an easier way...