• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Edit
Show / Hide Table of Contents

Get a CategoryList using the ListAgent

Some tooltip text!
• 1 minute to read
 • 1 minute to read
using SuperOffice;
using SuperOffice.CRM.Services;

using(SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
  //get the list agent
  using(ListAgent listAgent = new ListAgent())
  {
    //retrieve the category list using the methods of the agent
    Category[] catList =  listAgent.GetCategories();

    //loop through the list and output the value to the console
    foreach (Category item in catList)
    {
      if (item != null)
      {
        Console.WriteLine(item.Value);
      }
    }
  }
}

Here we have used the ListAgent to retrieve the category list. ListAgent offers specific methods to retrieve the lists that have been exposed by the NetServer. It returns an array of Category objects rather than general MDOListItems. However, the Category objects have no means of grouping the items into headings. It is always just a simple list of items.

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top