This topic contains 2 replies, has 0 voices, and was last updated by jphillipson 8 years, 6 months ago.
-
AuthorPosts
-
May 6, 2016 at 8:36 am #6700
karennHello all,
We are using SuiteTalk and C#. We getting the results from a saved search and one of the columns in the saved search is a field we added to the Item and that field uses a custom list for its values. No problems there. The problem comes in trying to get the value of the selected option in that field because in SuiteTalk saved search results, all you get is a pointer to the ListOrRecordRef.
Well after a lot of try and MANY errors I have something where I can at least the custom list in debug mode but I cannot figure out how to get to it. Nothing I try works. Here is the latest
foreach (SearchColumnCustomField custField in itmSearchRow.basic.customFieldList)
{
if (custField.scriptId == “custitem_zone”)
{
CustomizationRef[] custRef = new CustomizationRef[1];
custRef[0] = new CustomizationRef();
custRef[0].internalId = strCustomFld.searchValue.typeId;
custRef[0].type = RecordType.customList;
custRef[0].typeSpecified = true;
ReadResponseList readResponses = _service.getList(custRef);
foreach (ReadResponse readResponse in readResponses.readResponse)
{
CustomRecord custrec = (CustomRecord)readResponse.record;
}
}
}
Right or wrong if I examine custrec I see the list if I drill deep enough. How do I get the value from that custom list? If you runt he saved search in NetSuite it shows the value but I have not been able to figure ut how to get that value in SuiteTalk.
Thanks!
Karen
This is a cached copy. Click here to see the original post. -
May 9, 2016 at 1:31 pm #6701
karennAll,
I have figured it out. If anyone needs the answer here is
foreach (SearchColumnCustomField custField in itmSearchRow.basic.customFieldList)
{
if (custField.scriptId == “custitem_zone”)
{
SearchColumnSelectCustomField strCustomFld = (SearchColumnSelectCustomField)custField;
CustomizationRef[] custRef = new CustomizationRef[1];
custRef[0] = new CustomizationRef();
custRef[0].internalId = strCustomFld.searchValue.typeId;
custRef[0].type = RecordType.customList;
custRef[0].typeSpecified = true;
ReadResponseList readResponses = _service.getList(custRef);
foreach (ReadResponse readResponse in readResponses.readResponse)
{
CustomList custlist = (CustomList)readResponse.record;
foreach (CustomListCustomValue clValue in custlist.customValueList.customValue)
{
if (clValue.valueId == Convert.ToInt32(strCustomFld.searchValue.internalI d))
{
zone = clValue.value;
}
}
}
}
}
-
May 17, 2016 at 3:34 pm #6702
jphillipsonThanks! That was a big help to me. I was looking for the same information
-
AuthorPosts
You must be logged in to reply to this topic.