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

# NSSale

## Constructors

### NSSale()

```crmscript theme={null}
NSSale
```

Initializes a new instance of the NSSale class.

## Methods

## GetActiveErpLinks()

```crmscript theme={null}
Integer GetActiveErpLinks()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The number of active ERP links.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer activeErpLinks = thing.GetActiveErpLinks();
```

## GetAmount()

```crmscript theme={null}
Float GetAmount()
```

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - Total sale amount.

**Example:**

```crmscript theme={null}
NSSale thing;
Float amount = thing.GetAmount();
```

## GetAssociateFullName()

```crmscript theme={null}
String GetAssociateFullName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The sale's owner.

**Example:**

```crmscript theme={null}
NSSale thing;
String associateFullName = thing.GetAssociateFullName();
```

## GetAssociateId()

```crmscript theme={null}
Integer GetAssociateId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The sale's owner Id.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer associateId = thing.GetAssociateId();
```

## GetCompleted()

```crmscript theme={null}
Integer GetCompleted()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The Sale completed state.

<Note>
  The completed state is either Started or Completed. NotStarted is treated as Started. The value maps to the Done database field.
</Note>

**Example:**

```crmscript theme={null}
NSSale thing;
Integer completed = thing.GetCompleted();
```

## GetContactId()

```crmscript theme={null}
Integer GetContactId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Optional contact reference.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer contactId = thing.GetContactId();
```

## GetContactName()

```crmscript theme={null}
String GetContactName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Contact name.

**Example:**

```crmscript theme={null}
NSSale thing;
String contactName = thing.GetContactName();
```

## GetCurrency()

```crmscript theme={null}
String GetCurrency()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - NSCurrency the sale was made in.

**Example:**

```crmscript theme={null}
NSSale thing;
String currency = thing.GetCurrency();
```

## GetDescription()

```crmscript theme={null}
String GetDescription()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The sales description.

**Example:**

```crmscript theme={null}
NSSale thing;
String description = thing.GetDescription();
```

## GetEarning()

```crmscript theme={null}
Float GetEarning()
```

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - Earning on sale.

**Example:**

```crmscript theme={null}
NSSale thing;
Float earning = thing.GetEarning();
```

## GetEarningPercent()

```crmscript theme={null}
Float GetEarningPercent()
```

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - Earning as percent of total.

**Example:**

```crmscript theme={null}
NSSale thing;
Float earningPercent = thing.GetEarningPercent();
```

## GetNextDueDate()

```crmscript theme={null}
DateTime GetNextDueDate()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Next due date, this is a de-normalization of 'closest future activity date, or most recent if no future activities'.

<Note>
  Maintained by the system, but very convenient for searching.
</Note>

**Example:**

```crmscript theme={null}
NSSale thing;
DateTime nextDueDate = thing.GetNextDueDate();
```

## GetNumber()

```crmscript theme={null}
String GetNumber()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Alphanumeric user field.

**Example:**

```crmscript theme={null}
NSSale thing;
String number = thing.GetNumber();
```

## GetPersonFullName()

```crmscript theme={null}
String GetPersonFullName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The name of the person this sale belongs to.

**Example:**

```crmscript theme={null}
NSSale thing;
String personFullName = thing.GetPersonFullName();
```

## GetPersonId()

```crmscript theme={null}
Integer GetPersonId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The sale's contact persons Id.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer personId = thing.GetPersonId();
```

## GetProbability()

```crmscript theme={null}
Integer GetProbability()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Actual probability, may differ from the one in the list.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer probability = thing.GetProbability();
```

## GetProjectId()

```crmscript theme={null}
Integer GetProjectId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Optional project reference.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer projectId = thing.GetProjectId();
```

## GetProjectName()

```crmscript theme={null}
String GetProjectName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Project name.

**Example:**

```crmscript theme={null}
NSSale thing;
String projectName = thing.GetProjectName();
```

## GetSaleDate()

```crmscript theme={null}
DateTime GetSaleDate()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - (expected / lost / won) sales date.

**Example:**

```crmscript theme={null}
NSSale thing;
DateTime saleDate = thing.GetSaleDate();
```

## GetSaleId()

```crmscript theme={null}
Integer GetSaleId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Primary key.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer saleId = thing.GetSaleId();
```

## GetSaleTypeId()

```crmscript theme={null}
Integer GetSaleTypeId()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The sale's type Id.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer saleTypeId = thing.GetSaleTypeId();
```

## GetSaleTypeName()

```crmscript theme={null}
String GetSaleTypeName()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The sale's type name.

**Example:**

```crmscript theme={null}
NSSale thing;
String saleTypeName = thing.GetSaleTypeName();
```

## GetStatus()

```crmscript theme={null}
Integer GetStatus()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The sale's status, indicating wether the sale is open, sold or lost. See \<xref href="CRMScript.NetServer.SaleStatus" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSSale thing;
Integer status = thing.GetStatus();
```

## GetTitle()

```crmscript theme={null}
String GetTitle()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Sale heading (short description?).

**Example:**

```crmscript theme={null}
NSSale thing;
String title = thing.GetTitle();
```

## GetWeightedAmount()

```crmscript theme={null}
Float GetWeightedAmount()
```

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - The weighted amount ( amount \*  probability / 100).

**Example:**

```crmscript theme={null}
NSSale thing;
Float weightedAmount = thing.GetWeightedAmount();
```

## SetActiveErpLinks(Integer)

```crmscript theme={null}
Void SetActiveErpLinks(Integer activeErpLinks)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer activeErpLinks;
thing.SetActiveErpLinks(activeErpLinks);
```

## SetAmount(Float)

```crmscript theme={null}
Void SetAmount(Float amount)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Float amount;
thing.SetAmount(amount);
```

## SetAssociateFullName(String)

```crmscript theme={null}
Void SetAssociateFullName(String associateFullName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String associateFullName;
thing.SetAssociateFullName(associateFullName);
```

## SetAssociateId(Integer)

```crmscript theme={null}
Void SetAssociateId(Integer associateId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer associateId;
thing.SetAssociateId(associateId);
```

## SetCompleted(Integer)

```crmscript theme={null}
Void SetCompleted(Integer completed)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

<Note>
  The completed state is either Started or Completed. NotStarted is treated as Started. The value maps to the Done database field.
</Note>

**Example:**

```crmscript theme={null}
NSSale thing;
Integer completed;
thing.SetCompleted(completed);
```

## SetContactId(Integer)

```crmscript theme={null}
Void SetContactId(Integer contactId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer contactId;
thing.SetContactId(contactId);
```

## SetContactName(String)

```crmscript theme={null}
Void SetContactName(String contactName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String contactName;
thing.SetContactName(contactName);
```

## SetCurrency(String)

```crmscript theme={null}
Void SetCurrency(String currency)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String currency;
thing.SetCurrency(currency);
```

## SetDescription(String)

```crmscript theme={null}
Void SetDescription(String description)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String description;
thing.SetDescription(description);
```

## SetEarning(Float)

```crmscript theme={null}
Void SetEarning(Float earning)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Float earning;
thing.SetEarning(earning);
```

## SetEarningPercent(Float)

```crmscript theme={null}
Void SetEarningPercent(Float earningPercent)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Float earningPercent;
thing.SetEarningPercent(earningPercent);
```

## SetNextDueDate(DateTime)

Maintained by the system, but very convenient for searching.

```crmscript theme={null}
Void SetNextDueDate(DateTime nextDueDate)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
DateTime nextDueDate;
thing.SetNextDueDate(nextDueDate);
```

## SetNumber(String)

Alphanumeric user field

```crmscript theme={null}
Void SetNumber(String number)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String number;
thing.SetNumber(number);
```

## SetPersonFullName(String)

```crmscript theme={null}
Void SetPersonFullName(String personFullName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String personFullName;
thing.SetPersonFullName(personFullName);
```

## SetPersonId(Integer)

```crmscript theme={null}
Void SetPersonId(Integer personId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer personId;
thing.SetPersonId(personId);
```

## SetProbability(Integer)

```crmscript theme={null}
Void SetProbability(Integer probability)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer probability;
thing.SetProbability(probability);
```

## SetProjectId(Integer)

```crmscript theme={null}
Void SetProjectId(Integer projectId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer projectId;
thing.SetProjectId(projectId);
```

## SetProjectName(String)

```crmscript theme={null}
Void SetProjectName(String projectName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String projectName;
thing.SetProjectName(projectName);
```

## SetSaleDate(DateTime)

```crmscript theme={null}
Void SetSaleDate(DateTime saleDate)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
DateTime saleDate;
thing.SetSaleDate(saleDate);
```

## SetSaleId(Integer)

```crmscript theme={null}
Void SetSaleId(Integer saleId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer saleId;
thing.SetSaleId(saleId);
```

## SetSaleTypeId(Integer)

```crmscript theme={null}
Void SetSaleTypeId(Integer saleTypeId)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer saleTypeId;
thing.SetSaleTypeId(saleTypeId);
```

## SetSaleTypeName(String)

```crmscript theme={null}
Void SetSaleTypeName(String saleTypeName)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String saleTypeName;
thing.SetSaleTypeName(saleTypeName);
```

## SetStatus(Integer)

```crmscript theme={null}
Void SetStatus(Integer status)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Integer status;
thing.SetStatus(status);
```

## SetTitle(String)

```crmscript theme={null}
Void SetTitle(String title)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
String title;
thing.SetTitle(title);
```

## SetWeightedAmount(Float)

```crmscript theme={null}
Void SetWeightedAmount(Float weightedAmount)
```

**Returns:** [CRMScript.Global.Void](CRMScript.Global.Void)

**Example:**

```crmscript theme={null}
NSSale thing;
Float weightedAmount;
thing.SetWeightedAmount(weightedAmount);
```


## Related topics

- [NSSaleAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSSaleAgent.md)
- [NSSaleEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSSaleEntity.md)
- [NSSaleStakeholder](/en/automation/crmscript/reference/CRMScript.NetServer.NSSaleStakeholder.md)
- [NSSaleSummary](/en/automation/crmscript/reference/CRMScript.NetServer.NSSaleSummary.md)
- [NSSaleType](/en/automation/crmscript/reference/CRMScript.NetServer.NSSaleType.md)
- [NSSalesActivity](/en/automation/crmscript/reference/CRMScript.NetServer.NSSalesActivity.md)
