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

Update a basic property of an Entity

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

Before updating an Entity, it must be retrieved by using the Idx class.

Updating a basic property of an Entity means changing the values that are stored in properties of basic data types, such as integer or string.

using SuperOffice.CRM.Entities;
using SuperOffice.CRM.Rows;
using SuperOffice;
using(SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
  //Retrieving a Sale using the index of a Sale
  Sale newSale = Sale.GetFromIdxSaleId(2);

  //Update Sale properties directly
  newSale.ActiveLinks = 2;
  newSale.Amount = 100000.0;
  newSale.Earning = 50000;
  newSale.EarningPercent = 15;
  newSale.Heading = "Test edited for testing.";
  newSale.Status = SuperOffice.Data.SaleStatus.Sold;

if (newSale.IsDirty == true)
  {
    //Saving the Sale Entity
    newSale.Save();
  }
}
  1. Get an Entity from the sale table with row ID 2.
  2. Update properties of the sale (see below)
  3. Set the IsDirty property to true if there is any change made to that Entity.
  4. Call Save() to update any changed data in the database.
Property Type
ActiveLinks Unsigned Integer
Amount Double
Earning Double
EarningPercentage Double
Heading String
Status SuperOffice.Data.SaleStatus

See also

  • Update an Entity through an Entity
  • Update a Row through an Entity
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top