> ## 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.

# SuperOffice.WebApi.Data.SaleEntity

<h1 id="SuperOffice_WebApi_Data_SaleEntity">
  Class SaleEntity
</h1>

Namespace: [SuperOffice.WebApi.Data](SuperOffice.WebApi.Data.md)\
Assembly: SuperOffice.WebApi.dll

Carrier object for SaleEntity.
The Sale Entity contains the sale amount, currency, and sale members. Sales are linked to contacts, persons, and/or projects.

```csharp theme={null}
public class SaleEntity : Carrier
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[Carrier](SuperOffice.WebApi.Data.Carrier.md) ←
[SaleEntity](SuperOffice.WebApi.Data.SaleEntity.md)

#### Inherited Members

[Carrier.TableRight](SuperOffice.WebApi.Data.Carrier.md#SuperOffice_WebApi_Data_Carrier_TableRight),
[Carrier.FieldProperties](SuperOffice.WebApi.Data.Carrier.md#SuperOffice_WebApi_Data_Carrier_FieldProperties),
[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring),
[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

## Examples

Get SaleEntity 123 using the WebApi client:
\<pre>\<code class="lang-csharp">var configuration = new WebApiConfiguration(url);
var agent = new SaleAgent(configuration);
var saleEntity = agent.GetSaleEntity( 123 );\</code>\</pre>

## Remarks

Use \<xref href="SuperOffice.CRM.Services.ArchiveAgent?text=Archive+agent" data-throw-if-not-resolved="false">\</xref>:
All SaleEntity: \<pre>\<code class="lang-csharp">"FindSale"\</code>\</pre>
History: \<pre>\<code class="lang-csharp">"SaleHistory"\</code>\</pre> with restriction \<pre>\<code class="lang-csharp">"saleId eq " + id\</code>\</pre>.
Activities: \<pre>\<code class="lang-csharp">"SaleActivity"\</code>\</pre> with restriction \<pre>\<code class="lang-csharp">"saleId eq " + id\</code>\</pre>.
Guide: \<pre>\<code class="lang-csharp">"SaleGuide"\</code>\</pre> with restriction \<pre>\<code class="lang-csharp">"saleId eq " + id\</code>\</pre>.
Stakeholders: \<pre>\<code class="lang-csharp">"SaleStakeholder"\</code>\</pre> with restriction \<pre>\<code class="lang-csharp">"saleId eq " + id\</code>\</pre>.
Links: \<pre>\<code class="lang-csharp">"Links"\</code>\</pre> with restriction \<pre>\<code class="lang-csharp">"sourceSaleRestrictionId eq " + id\</code>\</pre>.

## Constructors

<h3 id="SuperOffice_WebApi_Data_SaleEntity__ctor">
  SaleEntity()
</h3>

Default constructor - defaults any enum props to 0.

```csharp theme={null}
public SaleEntity()
```

## Properties

<h3 id="SuperOffice_WebApi_Data_SaleEntity_ActiveErpLinks">
  ActiveErpLinks
</h3>

The number of active erp links

```csharp theme={null}
public virtual int ActiveErpLinks { get; set; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_ActiveLinks">
  ActiveLinks
</h3>

Number of active links to sale, document, appointment.

```csharp theme={null}
public virtual int ActiveLinks { get; set; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Amount">
  Amount
</h3>

Total sale amount

```csharp theme={null}
public virtual double Amount { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Appointment">
  Appointment
</h3>

```csharp theme={null}
public virtual Appointment Appointment { get; set; }
```

#### Property Value

[Appointment](SuperOffice.WebApi.Data.Appointment.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Associate">
  Associate
</h3>

The sale owner
\<p>Use MDO List name "associate" to get list items.\</p>

```csharp theme={null}
public virtual Associate Associate { get; set; }
```

#### Property Value

[Associate](SuperOffice.WebApi.Data.Associate.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Competitor">
  Competitor
</h3>

List of all possible competitors.
\<p>Use MDO List name "comptr" to get list items.\</p>

```csharp theme={null}
public virtual Competitor Competitor { get; set; }
```

#### Property Value

[Competitor](SuperOffice.WebApi.Data.Competitor.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Completed">
  Completed
</h3>

The Sale completed state. The completed state is either Started or Completed. NotStarted is treated as Started. The value maps to the Done database field.
NULL if unknown enum value.

```csharp theme={null}
[JsonIgnore]
public ActivityStatus? Completed { get; set; }
```

#### Property Value

[ActivityStatus](SuperOffice.WebApi.Data.ActivityStatus.md)?

#### See Also

[SaleEntity](SuperOffice.WebApi.Data.SaleEntity.md).[Completed\_String](SuperOffice.WebApi.Data.SaleEntity.md#SuperOffice_WebApi_Data_SaleEntity_Completed_String)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Completed_String">
  Completed\_String
</h3>

The Sale completed state. The completed state is either Started or Completed. NotStarted is treated as Started. The value maps to the Done database field.
Raw string enum value.

```csharp theme={null}
[JsonProperty("Completed")]
public string Completed_String { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

#### See Also

[SaleEntity](SuperOffice.WebApi.Data.SaleEntity.md).[Completed](SuperOffice.WebApi.Data.SaleEntity.md#SuperOffice_WebApi_Data_SaleEntity_Completed)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Contact">
  Contact
</h3>

The contact associated with the sale. It may also be 0 if no contact is associated with the sale.
\<p>Use MDO List name "contact" to get list items.\</p>

```csharp theme={null}
public virtual Contact Contact { get; set; }
```

#### Property Value

[Contact](SuperOffice.WebApi.Data.Contact.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_CreatedBy">
  CreatedBy
</h3>

Who created to sale

```csharp theme={null}
public virtual Associate CreatedBy { get; set; }
```

#### Property Value

[Associate](SuperOffice.WebApi.Data.Associate.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_CreatedDate">
  CreatedDate
</h3>

Registered date

```csharp theme={null}
public virtual DateTime CreatedDate { get; set; }
```

#### Property Value

[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Credited">
  Credited
</h3>

List of who is to be credited for the sale.
\<p>Use MDO List name "credited" to get list items.\</p>

```csharp theme={null}
public virtual Credited Credited { get; set; }
```

#### Property Value

[Credited](SuperOffice.WebApi.Data.Credited.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Currency">
  Currency
</h3>

The currency the sale object was sold in
\<p>Use MDO List name "currency" to get list items.\</p>

```csharp theme={null}
public virtual Currency Currency { get; set; }
```

#### Property Value

[Currency](SuperOffice.WebApi.Data.Currency.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_CustomFields">
  CustomFields
</h3>

Udef + Extra fields added to the carrier. Extra fields as defined by changes to database schema + user-defined fields as defined by admin.
Custom fields combines user defined fields and extra fields into one bucket.
The individual \<xref href="SuperOffice.WebApi.Data.SaleEntity.ExtraFields" data-throw-if-not-resolved="false">\</xref> and \<xref href="SuperOffice.WebApi.Data.SaleEntity.UserDefinedFields?text=UserDefinedFields" data-throw-if-not-resolved="false">\</xref> properties are deprecated in favor of this
combined collection.
The value string is the encoded value: "\[I:123]" or "\[DT:2019-09-11]".

```csharp theme={null}
public virtual StringDictionary CustomFields { get; set; }
```

#### Property Value

[StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

#### Remarks

The naming convention of the key string is as follows:
\<table>\<tbody>\<tr>\<td class="term">Extra field data\</td>\<td class="description">
\[Extra field name]\<p>\</p>
Example: \<pre>\<code class="lang-csharp">'x\_gorp' = '\[I:123]'\</code>\</pre>
\</td>\</tr>\<tr>\<td class="term">User defined field data\</td>\<td class="description">
\[Prog-id name]\<p>\</p>
Example: \<pre>\<code class="lang-csharp">'SuperOffice:1' = '\[I:123]'\</code>\</pre>\<p>\</p>
\</td>\</tr>\</tbody>\</table>

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Earning">
  Earning
</h3>

Earning on sale

```csharp theme={null}
public virtual double Earning { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_EarningPercent">
  EarningPercent
</h3>

Earning as percent of total

```csharp theme={null}
public virtual double EarningPercent { get; set; }
```

#### Property Value

[double](https://learn.microsoft.com/dotnet/api/system.double)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_ExtraFields">
  ExtraFields
</h3>

Deprecated: Use \<xref href="SuperOffice.WebApi.Data.SaleEntity.CustomFields" data-throw-if-not-resolved="false">\</xref> instead.
Extra fields added to the carrier. This could be data from Plug-ins, the foreign key system, external applications, etc.
The value string is the encoded value: "\[I:123]" or "\[DT:2019-09-11]".

```csharp theme={null}
public virtual StringDictionary ExtraFields { get; set; }
```

#### Property Value

[StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

#### Remarks

The naming convention of the key string is as follows:
\<table>\<tbody>\<tr>\<td class="term">Plug-in data\</td>\<td class="description">
\[Plug-in name].\[Property name]
Example: DocumentPlugin.DocumentType
\</td>\</tr>\<tr>\<td class="term">Foreign key data\</td>\<td class="description">
The device identity is appended directly to the device name if it exists.
This is not commonly used, but the database opens for this as a possibility to have several devices with the same name,
and hence we would ensure an unique key if this field is used.
Example: Audience.SecretService.DefaultCountry
\</td>\</tr>\<tr>\<td class="term">User defined table data\</td>\<td class="description">
\[Table name].\[Field name]
Example: Phunneling.AggregatedSales
\</td>\</tr>\<tr>\<td class="term">Other\</td>\<td class="description">
Other data sources must ensure an unique name. If the key already exists we do not add the data to the dictionary.
We also ensure that SuperOffice data are added first, so that existing data doesnt change when more data sources are added (with duplicate data keys).
\</td>\</tr>\</tbody>\</table>

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Heading">
  Heading
</h3>

Sale heading (short description?)

```csharp theme={null}
public virtual string Heading { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_IsPublished">
  IsPublished
</h3>

Publication is published

```csharp theme={null}
public virtual bool IsPublished { get; set; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Links">
  Links
</h3>

List of all elements linked to the sale.

```csharp theme={null}
public virtual Link[] Links { get; set; }
```

#### Property Value

[Link](SuperOffice.WebApi.Data.Link.md)\[]

<h3 id="SuperOffice_WebApi_Data_SaleEntity_NextDueDate">
  NextDueDate
</h3>

Next due date, this is a denormalization of 'closest future activity date, or most recent if no future activities'. Maintained by the system, but very convenient for searching.

```csharp theme={null}
public virtual DateTime NextDueDate { get; set; }
```

#### Property Value

[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Number">
  Number
</h3>

Alphanumeric user field

```csharp theme={null}
public virtual string Number { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Person">
  Person
</h3>

A sale may also be connected to a person - this must be a contact person registered on the current contact. This does not mean that a person is required.
\<p>Use MDO List name "person" to get list items.\</p>

```csharp theme={null}
public virtual Person Person { get; set; }
```

#### Property Value

[Person](SuperOffice.WebApi.Data.Person.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Postit">
  Postit
</h3>

The actual text, max 2047 significant characters even though it is stored as a larger data type on some databases

```csharp theme={null}
public virtual string Postit { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Probability">
  Probability
</h3>

Actual probability, may differ from the one in the list

```csharp theme={null}
public virtual short Probability { get; set; }
```

#### Property Value

[short](https://learn.microsoft.com/dotnet/api/system.int16)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Project">
  Project
</h3>

A sale may also be connected to a project, so you see the sale both on the company card, and on the project card. This does not mean that a project is required.
\<p>Use MDO List name "project" to get list items.\</p>

```csharp theme={null}
public virtual Project Project { get; set; }
```

#### Property Value

[Project](SuperOffice.WebApi.Data.Project.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_PublishEventDate">
  PublishEventDate
</h3>

Publish event date

```csharp theme={null}
public virtual DateTime PublishEventDate { get; set; }
```

#### Property Value

[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_PublishFrom">
  PublishFrom
</h3>

Publication valid from (inclusive)

```csharp theme={null}
public virtual DateTime PublishFrom { get; set; }
```

#### Property Value

[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_PublishTo">
  PublishTo
</h3>

Publication valid to (inclusive)

```csharp theme={null}
public virtual DateTime PublishTo { get; set; }
```

#### Property Value

[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Rating">
  Rating
</h3>

The sale rating
\<p>Use MDO List name "prob" to get list items.\</p>

```csharp theme={null}
public virtual Rating Rating { get; set; }
```

#### Property Value

[Rating](SuperOffice.WebApi.Data.Rating.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Reason">
  Reason
</h3>

The sale reason
\<p>Use MDO List name "reason" to get list items.\</p>

```csharp theme={null}
public virtual Reason Reason { get; set; }
```

#### Property Value

[Reason](SuperOffice.WebApi.Data.Reason.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_ReasonSold">
  ReasonSold
</h3>

\<p>Use MDO List name "reasonsold" to get list items.\</p>

```csharp theme={null}
public virtual ReasonSold ReasonSold { get; set; }
```

#### Property Value

[ReasonSold](SuperOffice.WebApi.Data.ReasonSold.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_ReasonStalled">
  ReasonStalled
</h3>

\<p>Use MDO List name "reasonstalled" to get list items.\</p>

```csharp theme={null}
public virtual ReasonStalled ReasonStalled { get; set; }
```

#### Property Value

[ReasonStalled](SuperOffice.WebApi.Data.ReasonStalled.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_ReopenDate">
  ReopenDate
</h3>

Date the sale is to be reopened; valid only for status=stalled. Not necessarily the same as the nextDueDate.

```csharp theme={null}
public virtual DateTime ReopenDate { get; set; }
```

#### Property Value

[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_SaleId">
  SaleId
</h3>

Primary key

```csharp theme={null}
public virtual int SaleId { get; set; }
```

#### Property Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_SaleStakeholders">
  SaleStakeholders
</h3>

```csharp theme={null}
public virtual SaleStakeholder[] SaleStakeholders { get; set; }
```

#### Property Value

[SaleStakeholder](SuperOffice.WebApi.Data.SaleStakeholder.md)\[]

<h3 id="SuperOffice_WebApi_Data_SaleEntity_SaleText">
  SaleText
</h3>

Text describing the sale

```csharp theme={null}
public virtual string SaleText { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_SaleType">
  SaleType
</h3>

\<p>Use MDO List name "saletype" to get list items.\</p>

```csharp theme={null}
public virtual SaleType SaleType { get; set; }
```

#### Property Value

[SaleType](SuperOffice.WebApi.Data.SaleType.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Saledate">
  Saledate
</h3>

(expected / lost / won) sales date

```csharp theme={null}
public virtual DateTime Saledate { get; set; }
```

#### Property Value

[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Source">
  Source
</h3>

The sale source
\<p>Use MDO List name "source" to get list items.\</p>

```csharp theme={null}
public virtual Source Source { get; set; }
```

#### Property Value

[Source](SuperOffice.WebApi.Data.Source.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Status">
  Status
</h3>

The state of the Sale: Open / Sold / Lost / Stalled
NULL if unknown enum value.

```csharp theme={null}
[JsonIgnore]
public SaleStatus? Status { get; set; }
```

#### Property Value

[SaleStatus](SuperOffice.WebApi.Data.SaleStatus.md)?

#### See Also

[SaleEntity](SuperOffice.WebApi.Data.SaleEntity.md).[Status\_String](SuperOffice.WebApi.Data.SaleEntity.md#SuperOffice_WebApi_Data_SaleEntity_Status_String)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_Status_String">
  Status\_String
</h3>

The state of the Sale: Open / Sold / Lost / Stalled
Raw string enum value.

```csharp theme={null}
[JsonProperty("Status")]
public string Status_String { get; set; }
```

#### Property Value

[string](https://learn.microsoft.com/dotnet/api/system.string)

#### See Also

[SaleEntity](SuperOffice.WebApi.Data.SaleEntity.md).[Status](SuperOffice.WebApi.Data.SaleEntity.md#SuperOffice_WebApi_Data_SaleEntity_Status)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_UpdatedBy">
  UpdatedBy
</h3>

Who updated the sale

```csharp theme={null}
public virtual Associate UpdatedBy { get; set; }
```

#### Property Value

[Associate](SuperOffice.WebApi.Data.Associate.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_UpdatedDate">
  UpdatedDate
</h3>

Last updated

```csharp theme={null}
public virtual DateTime UpdatedDate { get; set; }
```

#### Property Value

[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_UserDefinedFields">
  UserDefinedFields
</h3>

Deprecated: Use \<xref href="SuperOffice.WebApi.Data.SaleEntity.CustomFields" data-throw-if-not-resolved="false">\</xref> instead.
Dictionary of user defined field data.
The key string is the ProgId of the UdefField, or if the ProgId is empty it is a string of the format "SuperOffice:\[UdefFieldIdentity]", e.g. "SuperOffice:1234"
The value string is the encoded value: "\[I:123]" or "\[DT:2019-09-11]".

```csharp theme={null}
public virtual StringDictionary UserDefinedFields { get; set; }
```

#### Property Value

[StringDictionary](SuperOffice.WebApi.Data.StringDictionary.md)

<h3 id="SuperOffice_WebApi_Data_SaleEntity_VisibleFor">
  VisibleFor
</h3>

The set of users or groups the record is visible for

```csharp theme={null}
public virtual VisibleFor[] VisibleFor { get; set; }
```

#### Property Value

[VisibleFor](SuperOffice.WebApi.Data.VisibleFor.md)\[]

## See Also

[SaleAgent](SuperOffice.WebApi.Agents.SaleAgent.md),
[ArchiveAgent](SuperOffice.WebApi.Agents.ArchiveAgent.md),


## Related topics

- [SuperOffice.WebApi.Data.Sale ValidateSaleEntityRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Sale_ValidateSaleEntityRequest.md)
- [SuperOffice.WebApi.Agents.SaleAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.SaleAgent.md)
- [SuperOffice.WebApi.Agents.ISaleAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ISaleAgent.md)
- [Validate Sale Entity](/en/api/reference/restful/agent/sale_agent/validate-sale-entity.md)
