Skip to content

Instantly share code, notes, and snippets.

@thuutien
Created September 21, 2023 16:49
Show Gist options
  • Save thuutien/64fa83ba0d476f055c1b40b1a2a7c7ac to your computer and use it in GitHub Desktop.
Save thuutien/64fa83ba0d476f055c1b40b1a2a7c7ac to your computer and use it in GitHub Desktop.
Successful NetSuite Saved Search SOAP .NET core
NetSuiteService nss = new NetSuiteService();
nss.Url = "https://your-accountID.suitetalk.api.netsuite.com/services/NetSuitePort_2023_1";
nss.tokenPassport = CreateTokenPassport(); //
TransactionSearchAdvanced tranSearch = new TransactionSearchAdvanced(); //TransactionSearchAdvanced type depends on your search object references.
tranSearch.savedSearchId = "searchID here";
try
{
var searchResult = nss.search(tranSearch);
if (searchResult.status.isSuccess)
{
totalUnit = searchResult.searchRowList.Length;
foreach (var r in searchResult.searchRowList)
{
var row = r as TransactionSearchRow; //
if (row != null)
{
Console.WriteLine(row.basic.amount[0].searchValue);
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
@thuutien
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment