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

Delete an Entity

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

To delete an Entity, we have to use the Delete() method of that entity.

Note

Deleting an Entity will not delete any Entities or Rows that are parts of its properties.

using SuperOffice.CRM.Entities;
using SuperOffice.CRM.Rows;
using SuperOffice;
using (SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
  //Retrieve an entity
  Sale newSale = Sale.GetFromIdxSaleId(49);

  //Deleting the Entity
  newSale.Delete();

  //Checking whether the entity has been deleted
  if (newSale.IsDeleted == true)
  {
    string test = "The sale has been deleted";
  }
}

Before we delete any entity, we have to retrieve it. Once an Entity is retrieved, we can simply use the Delete() method and remove that particular Entity from the database.

See also

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