Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
get custom list issue
I'm trying to get the contents of a custom list, and found another thread that offered C# code to do just that, which I used to write the code below: (original post and code) https://usergroup.netsuite.com/users/showpost.php?p=94414&postcount=8
my code:
protected void getNetSuiteList(string listId, out string statusDetail) { statusDetail = ""; if (NetSuite.misc.Login()) { RecordRef recRef = new RecordRef(); recRef.internalId = listId; recRef.type = RecordType.customList; recRef.typeSpecified = true; ReadResponse response = NetSuite.misc._service.get(recRef); if (response.status.isSuccess) { CustomList list = (CustomList)response.record; foreach (CustomListCustomValue listValue in list.customValueList.customValue) { Response.Write(listValue.valueId.ToString() + "=" + listValue.value); } } else { statusDetail = response.status.statusDetail[0].message; Response.Write(statusDetail); } } } 0