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

Create a Row with basic properties

Some tooltip text!
• 1 minute to read
 • 1 minute to read

This example shows how to create a Row and populate some very basic properties.

using SuperOffice;
using SuperOffice.CRM.Rows;
using(SoSession newSession = SoSession.Authenticate("SAL0", ""))
{
  //Create a New Row
  ContactRow myContactRow = ContactRow.CreateNew();
  myContactRow.SetDefaults();

  //Assign values to its basic properties
  myContactRow.Name = "SuperOffice ASA";
  myContactRow.Department = "ABC Dept";

  //Retrieve a country row and assign the country id of that row
  CountryRow myCountry = CountryRow.GetFromIdxName("Algeria");
  myContactRow.CountryId = myCountry.CountryId;

  // Finally save the row
  myContactRow.Save();
}
  1. Get a CountryRow using the IdxName method.
  2. Get countryId from the countryRow.
  3. Assign a value to the CountryId property of the ContactRow.

You can even assign an integer value to the property directly.

Note

If you assign an ID of a non-existing countryRow to the CountryId property of the ContactRow, no exception will be thrown and that value will be stored in the database. But when you retrieve the CountryId property through ContactEntity, you will always get 0 if it’s a non-existing row.

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