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

# NSSaleTypeEntity

## Constructors

### NSSaleTypeEntity()

```crmscript theme={null}
NSSaleTypeEntity
```

Initializes a new instance of the NSSaleTypeEntity class.

## Methods

## GetAllowQuoteAlternatives()

```crmscript theme={null}
Bool GetAllowQuoteAlternatives()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Can quotes linked to sales of this type, have multiple Alternatives.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool allowQuoteAlternatives = thing.GetAllowQuoteAlternatives();
```

## GetConfirmationLinesTemplate()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The template that this sale type should use when producing the order confirmation lines document; the template must have DocTmplQuoteType=ConfirmationLines.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer confirmationLinesTemplate = thing.GetConfirmationLinesTemplate();
```

## GetDefaultQuoteValidity()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Default valid days for quotes linked to sales of this type (valid from quote transmission).

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer defaultQuoteValidity = thing.GetDefaultQuoteValidity();
```

## GetDeleted()

```crmscript theme={null}
Bool GetDeleted()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - 0 -> record is active 1 -> record is 'deleted' and should not be shown in lists.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool deleted = thing.GetDeleted();
```

## GetDurationUnit()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Units for the duration (day, week, whatever). See \<xref href="CRMScript.NetServer.DurationUnit" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer durationUnit = thing.GetDurationUnit();
```

## GetGroupQuoteLinesBy()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Group quote lines by this field.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer groupQuoteLinesBy = thing.GetGroupQuoteLinesBy();
```

## GetHasGuide()

```crmscript theme={null}
Bool GetHasGuide()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Does this sale type have a guide attached.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool hasGuide = thing.GetHasGuide();
```

## GetHasStakeholders()

```crmscript theme={null}
Bool GetHasStakeholders()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Does this sale type have stakeholders.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool hasStakeholders = thing.GetHasStakeholders();
```

## GetIsAutoAdvance()

```crmscript theme={null}
Bool GetIsAutoAdvance()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Does the sale stage advance automatically, when the last guided activity in a stage is completed?

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool isAutoAdvance = thing.GetIsAutoAdvance();
```

## GetMaxDiscountPercent()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The maximum discount in percent of total, if set, on quotes linked to sales of this type.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer maxDiscountPercent = thing.GetMaxDiscountPercent();
```

## GetMaxDiscountPercentSet()

```crmscript theme={null}
Bool GetMaxDiscountPercentSet()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Is there a limit, in percent, to the total discount on quotes linked to sales of this type.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool maxDiscountPercentSet = thing.GetMaxDiscountPercentSet();
```

## GetMinEarningPercent()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The minimum earning in percent of total, if set, on quotes linked to sales of this type.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer minEarningPercent = thing.GetMinEarningPercent();
```

## GetMinEarningPercentSet()

```crmscript theme={null}
Bool GetMinEarningPercentSet()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Is there a limit, in earning as percent of total, on quotes linked to sales of this type.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool minEarningPercentSet = thing.GetMinEarningPercentSet();
```

## GetName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The list item.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
String name = thing.GetName();
```

## GetQuoteLinesTemplate()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The template that this sale type should use when producing the product lines offer document; the template must have DocTmplQuoteType=QuoteLines.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer quoteLinesTemplate = thing.GetQuoteLinesTemplate();
```

## GetRank()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Rank order.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer rank = thing.GetRank();
```

## GetSaleDuration()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Expected number of dales from initiation to close of sale.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer saleDuration = thing.GetSaleDuration();
```

## GetSaleTypeCatId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Category of sale type, copied to sale.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer saleTypeCatId = thing.GetSaleTypeCatId();
```

## GetSaleTypeId()

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

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

**Example:**

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

## GetSortGroupLinesBy()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Sort group lines by this field.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer sortGroupLinesBy = thing.GetSortGroupLinesBy();
```

## GetStages()

```crmscript theme={null}
NSSelectableMDOListItem[] GetStages()
```

**Returns:** [CRMScript.NetServer.NSSelectableMDOListItem](CRMScript.NetServer.NSSelectableMDOListItem)\[] - Stages, those associated with this NSSaleType are selected.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
NSSelectableMDOListItem[] stages = thing.GetStages();
```

## GetTooltip()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Tooltip or other description.

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
String tooltip = thing.GetTooltip();
```

## SetAllowQuoteAlternatives(Bool)

```crmscript theme={null}
Void SetAllowQuoteAlternatives(Bool allowQuoteAlternatives)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool allowQuoteAlternatives;
thing.SetAllowQuoteAlternatives(allowQuoteAlternatives);
```

## SetConfirmationLinesTemplate(Integer)

```crmscript theme={null}
Void SetConfirmationLinesTemplate(Integer confirmationLinesTemplate)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer confirmationLinesTemplate;
thing.SetConfirmationLinesTemplate(confirmationLinesTemplate);
```

## SetDefaultQuoteValidity(Integer)

```crmscript theme={null}
Void SetDefaultQuoteValidity(Integer defaultQuoteValidity)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer defaultQuoteValidity;
thing.SetDefaultQuoteValidity(defaultQuoteValidity);
```

## SetDeleted(Bool)

```crmscript theme={null}
Void SetDeleted(Bool deleted)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool deleted;
thing.SetDeleted(deleted);
```

## SetDurationUnit(Integer)

```crmscript theme={null}
Void SetDurationUnit(Integer durationUnit)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer durationUnit;
thing.SetDurationUnit(durationUnit);
```

## SetGroupQuoteLinesBy(Integer)

```crmscript theme={null}
Void SetGroupQuoteLinesBy(Integer groupQuoteLinesBy)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer groupQuoteLinesBy;
thing.SetGroupQuoteLinesBy(groupQuoteLinesBy);
```

## SetHasGuide(Bool)

```crmscript theme={null}
Void SetHasGuide(Bool hasGuide)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool hasGuide;
thing.SetHasGuide(hasGuide);
```

## SetHasStakeholders(Bool)

```crmscript theme={null}
Void SetHasStakeholders(Bool hasStakeholders)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool hasStakeholders;
thing.SetHasStakeholders(hasStakeholders);
```

## SetIsAutoAdvance(Bool)

```crmscript theme={null}
Void SetIsAutoAdvance(Bool isAutoAdvance)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool isAutoAdvance;
thing.SetIsAutoAdvance(isAutoAdvance);
```

## SetMaxDiscountPercent(Integer)

```crmscript theme={null}
Void SetMaxDiscountPercent(Integer maxDiscountPercent)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer maxDiscountPercent;
thing.SetMaxDiscountPercent(maxDiscountPercent);
```

## SetMaxDiscountPercentSet(Bool)

```crmscript theme={null}
Void SetMaxDiscountPercentSet(Bool maxDiscountPercentSet)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool maxDiscountPercentSet;
thing.SetMaxDiscountPercentSet(maxDiscountPercentSet);
```

## SetMinEarningPercent(Integer)

```crmscript theme={null}
Void SetMinEarningPercent(Integer minEarningPercent)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer minEarningPercent;
thing.SetMinEarningPercent(minEarningPercent);
```

## SetMinEarningPercentSet(Bool)

```crmscript theme={null}
Void SetMinEarningPercentSet(Bool minEarningPercentSet)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Bool minEarningPercentSet;
thing.SetMinEarningPercentSet(minEarningPercentSet);
```

## SetName(String)

```crmscript theme={null}
Void SetName(String name)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
String name;
thing.SetName(name);
```

## SetQuoteLinesTemplate(Integer)

```crmscript theme={null}
Void SetQuoteLinesTemplate(Integer quoteLinesTemplate)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer quoteLinesTemplate;
thing.SetQuoteLinesTemplate(quoteLinesTemplate);
```

## SetRank(Integer)

```crmscript theme={null}
Void SetRank(Integer rank)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer rank;
thing.SetRank(rank);
```

## SetSaleDuration(Integer)

```crmscript theme={null}
Void SetSaleDuration(Integer saleDuration)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer saleDuration;
thing.SetSaleDuration(saleDuration);
```

## SetSaleTypeCatId(Integer)

```crmscript theme={null}
Void SetSaleTypeCatId(Integer saleTypeCatId)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer saleTypeCatId;
thing.SetSaleTypeCatId(saleTypeCatId);
```

## SetSaleTypeId(Integer)

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

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

**Example:**

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

## SetSortGroupLinesBy(Integer)

```crmscript theme={null}
Void SetSortGroupLinesBy(Integer sortGroupLinesBy)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
Integer sortGroupLinesBy;
thing.SetSortGroupLinesBy(sortGroupLinesBy);
```

## SetStages(NSSelectableMDOListItem\[])

```crmscript theme={null}
Void SetStages(NSSelectableMDOListItem[] stages)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
NSSelectableMDOListItem[] stages;
thing.SetStages(stages);
```

## SetTooltip(String)

```crmscript theme={null}
Void SetTooltip(String tooltip)
```

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

**Example:**

```crmscript theme={null}
NSSaleTypeEntity thing;
String tooltip;
thing.SetTooltip(tooltip);
```


## Related topics

- [NSListAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSListAgent.md)
- [Delete Sale Type Entity](/en/api/reference/restful/rest/list_saletype/delete-sale-type-entity.md)
- [Put Sale Type Entity](/en/api/reference/restful/rest/list_saletype/put-sale-type-entity.md)
- [Post Sale Type Entity](/en/api/reference/restful/rest/list_saletype/post-sale-type-entity.md)
- [Get Sale Type Entity](/en/api/reference/restful/rest/list_saletype/get-sale-type-entity.md)
- [Save Sale Type Entity](/en/api/reference/restful/agent/list_agent/save-sale-type-entity.md)
