List Vendors (Legacy)
This example shows you how to:
- Execute a query to list vendors.
- Read any additional paginated results from the query.
Prerequisites
- You have downloaded or cloned the Sage Intacct SDK for .NET examples.
- You successfully ran the getting started example—in particular, you set up the
credentials.ini
file required byBootstrap.cs
. - The company you are using has multiple vendor records.
- The user you are using has list and view permissions for the vendor object.
Run the example
-
Run the project, and enter
3
when prompted.For example, the following runs the project from the command line:
cd Intacct.Examples "C:\Program Files\dotnet\dotnet.exe" bin/Debug/netcoreappX.X/Intacct.Examples.dll
-
Observe the terminal output.
The number of vendor records found and each page remaining echo to the terminal:
Page 1 success! Number of vendor records found: 14. Number remaining: 12 Page 2 success! Records remaining: 10 Page 3 success! Records remaining: 8 Page 4 success! Records remaining: 6 Successfully read 4 pages
-
Type
6
to exit the program. -
Open the generated
Intacct.Examples/bin/Debug/netcoreappX.X/logs/intacct.log
file in a text editor and review the entries.The file provides info and debug entries. The SDK provides a debug entry for each HTTP request/response (with the Sage Intacct endpoint).
Note that the log file was created by the logger set in the client config.
Extra credit
Filter the results
-
Set a
Intacct\Functions\Common\Query\QueryInterface
on theReadByQuery
object to filter the number of results. For example, add the following to the example to list only active vendors:EqualToString where = new EqualToString() { Field = "STATUS", Value = "T", }; query.Query = where;
Try a different object
-
Query for
APBILL
objects by changing theObjectName
property, as follows:ObjectName = "VENDOR",
-
Modify the
Fields
array to return the information you want.
What’s next?
- Try an example that creates, reads, updates, and deletes a customer.
- Browse the reference documentation for the SDK.