This topic contains 2 replies, has 0 voices, and was last updated by jphillipson 8 years, 6 months ago.

  • Author
    Posts
  • #6700

    karenn

    Hello 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.

  • #6701

    karenn

    All,

    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;

    }

    }

    }

    }

    }

  • #6702

    jphillipson

    Thanks! That was a big help to me. I was looking for the same information

You must be logged in to reply to this topic.