Here is an example of code I use to read any custom list and create a Dictionary<string, long> of the result.
Custom lists can be found at: Customization >> List, Records, & Fields >> Lists
Here is an example of a custom list:
Simply call this method, passing the scriptId of the list you want to be returned as a Dictionary<string, long>.
Here is the code so you can paste it into your project:
public static Dictionary<string, long> GetCustomListValues(
NetSuiteService service, string custom_list_name)
{
Dictionary<string, long> results = new Dictionary<string, long>();
CustomListSearchBasic basic = new CustomListSearchBasic()
{
scriptId = new SearchStringField()
{
@operator = SearchStringFieldOperator.@is
,
operatorSpecified = true
,
searchValue = custom_list_name
}
};
service.tokenPassport = NSExtensions.TBAtoken.createTokenPassport();
SearchResult result = service.search(basic);
if (result.status.isSuccess)
{
RecordRef recordRef = new RecordRef();
recordRef.internalId = ((CustomList) result.recordList[0]).internalId;
recordRef.type = RecordType.customList;
recordRef.typeSpecified = true;
service.tokenPassport = NSExtensions.TBAtoken.createTokenPassport();
ReadResponse response = service.get(recordRef);
if (response.status.isSuccess)
{
CustomList list = (CustomList) response.record;
foreach (CustomListCustomValue value in list.customValueList.customValue)
{
results.Add(value.value, value.valueId);
}
}
}
return results;
}