Delete a Row through an Entity
Some tooltip text!
• 1 minute to read
• 1 minute to read
We are aware that some properties of an Entity are of Row type. Hence, by using the Delete
method we can delete a Row as well. In this case, it will delete an entire row from the database.
This example shows the use of the Delete()
method to delete a Row property of a Sale
Entity.
using SuperOffice;
using SuperOffice.CRM.Entities;
using SuperOffice.CRM.Rows;
using(SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
//Retrieve an entity
Sale newSale = Sale.GetFromIdxSaleId(48);
//Deleting a Currency through a Sale
newSale.Currency.Delete();
//Using IsDelete to check whether the Currency has been deleted
if (newSale.Currency.IsDeleted == true)
{
string test2 = "Currency has been deleted";
}
}
When Delete()
is executed above, it will delete the relevant currency row from the Currency
table in the database.