NetSuite SuiteTalk - Retrieve Value String From “SearchColumnSelectCustomField”

后端 未结 2 2014
我在风中等你
我在风中等你 2021-01-07 10:15

I have a small application that iterates over the results of a \"Saved Search\" retrieving the values from several Custom Columns(simplified example):

var re         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-07 11:00

    I tried the answer posted by @Adud123 and it works great, Here's what the code looks like:

    public Dictionary> getCustomFieldLists()
    {
        return
            nsService.search(new CustomListSearch())
                .recordList.Select(a => (CustomList) a)
                .ToDictionary(a => a.internalId,
                    a => a.customValueList.customValue
                         .ToDictionary(b => b.valueId, c => c.value));
    }
    
    var valueLookup = getCustomFieldLists();
    
    var results = searchResults.Select(a => new
    {
        Z = (a.basic.customFieldList.Where(b => b.scriptId == "custentityZ")
            .Select(a => (SearchColumnSelectCustomField)a)
            .Select(a => valueLookup[a.searchValue.typeId][a.searchValue.internalId])
            .First()
    }
    

提交回复
热议问题