> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a basic property of an Entity

> How to update an Entity

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.

```csharp theme={null}
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][1]
* [Update a Row through an Entity][2]

[1]: ./update-entity-in-entity

[2]: ../rows/update-row-in-entity


## Related topics

- [Update a person with a new name, address, position using services](/en/api/web-services/howto/contact/update-person-services.md)
- [Update Hierarchy From Path](/en/api/reference/restful/agent/list_agent/update-hierarchy-from-path.md)
- [Update multiple records (bulk update)](/en/learn/basics/bulk-update.md)
- [Practical details - how to use Bulk Update API](/en/api/bulk-operations/bulk-update/using-bulk-update.md)
- [Entities and field types](/en/api/bulk-operations/bulk-update/entities-field-types.md)
- [Working with companies in API](/en/company/dev/index.md)
- [Retrieve quote info](/en/automation/crmscript/howto/quote/get.md)
