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

# NSQuoteAlternative

> Information about a connection to the ERP system.

Information about a connection to the ERP system.

## Constructors

### NSQuoteAlternative()

```crmscript theme={null}
NSQuoteAlternative
```

Initializes a new instance of the NSQuoteAlternative class.

## Methods

## GetDescription()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The tool-tip to use in the user interface (on the tab, for instance).

**Example:**

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

## GetDiscountAmount()

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - The discount the sales rep specifies, in whatever currency the sale is in.

<Note>
  Both the two 'DiscountPercent' and 'DiscountAmount' shall be filled out, but the UserValueOverride field must be set to the field the user actually changed. If this field is filled out by the user, it overrides the discount suggested by the connector. If the user has not filled any values, the system will copy the ERP discount amount value into this field.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float discountAmount = thing.GetDiscountAmount();
```

## GetDiscountPercent()

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - The discount the sales rep specifies, in percent. '12%' is represented as '12'.

<Note>
  Both the two 'DiscountPercent' and 'DiscountAmount' shall be filled out, but the UserValueOverride field must be set to the field the user actually changed. If this field is filled out by the user, it overrides the discount suggested by the connector. If the user has not filled any values, the system will copy the ERP discount percent value into this field.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float discountPercent = thing.GetDiscountPercent();
```

## GetEarningAmount()

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - Earning on this alternative, as an absolute amount.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float earningAmount = thing.GetEarningAmount();
```

## GetEarningPercent()

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - The earning on this alternative, in percent of total. The Percentage is given in integer form, '12%' is represented as '12'.

**Example:**

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

## GetERPDiscountAmount()

Can be overridden by the user in the field 'DiscountPercent' or 'DiscountAmount'. Both the two 'ERPDiscountPercent' and 'ERPDiscountAmount' shall be filled out. If UserValueOverride is 'None', then the ERPDiscountAmount shall be copied into DiscountAmount and ERPDiscountPercent into DiscountPercent.

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - The discount the system calculates based on customer /amount / whatever.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float eRPDiscountAmount = thing.GetERPDiscountAmount();
```

## GetERPDiscountPercent()

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - The discount the system calculates based on customer /amount / whatever. The Percentage is given in integer form, '12%' is represented as '12'.

<Note>
  Can be overridden by the sales rep in the field 'DiscountPercent' or 'DiscountAmount'. Both the two 'ERPDiscountPercent' and 'ERPDiscountAmount' shall be filled out. If UserValueOverride is 'None', then the ERPDiscountAmount shall be copied into DiscountAmount and ERPDiscountPercent into DiscountPercent.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float eRPDiscountPercent = thing.GetERPDiscountPercent();
```

## GetERPQuoteAlternativeKey()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Key that identifies this alternative in the ERP system, if it exists there.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String eRPQuoteAlternativeKey = thing.GetERPQuoteAlternativeKey();
```

## GetExtraField1()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Optional information added by Quote Connector; usable in the quote document merge process.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField1 = thing.GetExtraField1();
```

## GetExtraField2()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Optional information added by Quote Connector; usable in the quote document merge process.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField2 = thing.GetExtraField2();
```

## GetExtraField3()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Optional information added by Quote Connector; usable in the quote document merge process.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField3 = thing.GetExtraField3();
```

## GetExtraField4()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Optional information added by Quote Connector; usable in the quote document merge process.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField4 = thing.GetExtraField4();
```

## GetExtraField5()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Optional information added by Quote Connector; usable in the quote document merge process.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField5 = thing.GetExtraField5();
```

## GetName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of Alternative. Shown in tab in user interface, intentionally kept short.

**Example:**

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

## GetQuoteAlternativeId()

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

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Integer quoteAlternativeId = thing.GetQuoteAlternativeId();
```

## GetQuoteVersionId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The version that owns this alternative (the chain is Sale 1->1 Quote 1->+ QuoteVersion 1->+ QuoteAlternative.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Integer quoteVersionId = thing.GetQuoteVersionId();
```

## GetReason()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - If there was a problem, this field contains a localized explanation of the problem and possible steps to fix it that the user can be shown.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String reason = thing.GetReason();
```

## GetStatus()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - If there was a problem with for instance calculation, this field is set to warning or error. See \<xref href="CRMScript.NetServer.QuoteStatus" data-throw-if-not-resolved="false">\</xref>.

**Example:**

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

## GetSubTotal()

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - Value to help the user interface, is computed by summing the total price of the quote lines, and NOT by summing their subtotals.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float subTotal = thing.GetSubTotal();
```

## GetTotalPrice()

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - Sum of the QuoteLines.TotalPrice, AlternativeDiscount or QuoteLines.TotalCost + Earning based on what, if anything, the user has entered last. Shall be calculated by the connector.

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float totalPrice = thing.GetTotalPrice();
```

## GetUserValueOverride()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Has the pre-calculated (from ERP) price information been overridden, and how. See \<xref href="CRMScript.NetServer.ValueOverride" data-throw-if-not-resolved="false">\</xref>.

<Note>
  If the user has filled out the discountpercentage field, then the UserValueOverride field is set to OverridePercent. (The DiscountAmount, EarningPercent, EarningAmount and TotalPrice fields are calculated based on the discountPercent.)
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Integer userValueOverride = thing.GetUserValueOverride();
```

## GetVAT()

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

**Returns:** [CRMScript.Global.Float](CRMScript.Global.Float) - Tax/VAT, THIS IS AN AMOUNT, available as a merge field in the quote document.

<Note>
  The SuperOffice quote connector will calculate this field based on the vat PERCENTAGES on the individual lines; other connectors may implement other algorithms at will.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float vAT = thing.GetVAT();
```

## GetVATInfo()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Extra info about VAT that the connector might insert.

<Note>
  This field has no business logic in the CRM code, but is available as a merge field in the quote documents.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String vATInfo = thing.GetVATInfo();
```

## SetDescription(String)

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

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

**Example:**

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

## SetDiscountAmount(Float)

```crmscript theme={null}
Void SetDiscountAmount(Float discountAmount)
```

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

<Note>
  If this field is filled out by the user, it overrides the discount suggested by the connector. If the user has not filled any values, the system will copy the ERP discount amount value into this field.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float discountAmount;
thing.SetDiscountAmount(discountAmount);
```

## SetDiscountPercent(Float)

```crmscript theme={null}
Void SetDiscountPercent(Float discountPercent)
```

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

<Note>
  If this field is filled out by the user, it overrides the discount suggested by the connector. If the user has not filled any values, the system will copy the ERP discount percent value into this field.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float discountPercent;
thing.SetDiscountPercent(discountPercent);
```

## SetEarningAmount(Float)

```crmscript theme={null}
Void SetEarningAmount(Float earningAmount)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float earningAmount;
thing.SetEarningAmount(earningAmount);
```

## SetEarningPercent(Float)

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

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

**Example:**

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

## SetERPDiscountAmount(Float)

```crmscript theme={null}
Void SetERPDiscountAmount(Float eRPDiscountAmount)
```

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

<Note>
  Can be overridden by the user in the field 'DiscountPercent' or 'DiscountAmount'. Both the two 'ERPDiscountPercent' and 'ERPDiscountAmount' shall be filled out. If UserValueOverride is 'None', then the ERPDiscountAmount shall be copied into DiscountAmount and ERPDiscountPercent into DiscountPercent.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float eRPDiscountAmount;
thing.SetERPDiscountAmount(eRPDiscountAmount);
```

## SetERPDiscountPercent(Float)

```crmscript theme={null}
Void SetERPDiscountPercent(Float eRPDiscountPercent)
```

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

<Note>
  Can be overridden by the sales rep in the field 'DiscountPercent' or 'DiscountAmount'. Both the two 'ERPDiscountPercent' and 'ERPDiscountAmount' shall be filled out. If UserValueOverride is 'None', then the ERPDiscountAmount shall be copied into DiscountAmount and ERPDiscountPercent into DiscountPercent.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float eRPDiscountPercent;
thing.SetERPDiscountPercent(eRPDiscountPercent);
```

## SetERPQuoteAlternativeKey(String)

```crmscript theme={null}
Void SetERPQuoteAlternativeKey(String eRPQuoteAlternativeKey)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String eRPQuoteAlternativeKey;
thing.SetERPQuoteAlternativeKey(eRPQuoteAlternativeKey);
```

## SetExtraField1(String)

```crmscript theme={null}
Void SetExtraField1(String extraField1)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField1;
thing.SetExtraField1(extraField1);
```

## SetExtraField2(String)

```crmscript theme={null}
Void SetExtraField2(String extraField2)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField2;
thing.SetExtraField2(extraField2);
```

## SetExtraField3(String)

```crmscript theme={null}
Void SetExtraField3(String extraField3)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField3;
thing.SetExtraField3(extraField3);
```

## SetExtraField4(String)

```crmscript theme={null}
Void SetExtraField4(String extraField4)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField4;
thing.SetExtraField4(extraField4);
```

## SetExtraField5(String)

```crmscript theme={null}
Void SetExtraField5(String extraField5)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String extraField5;
thing.SetExtraField5(extraField5);
```

## SetName(String)

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

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

**Example:**

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

## SetQuoteAlternativeId(Integer)

```crmscript theme={null}
Void SetQuoteAlternativeId(Integer quoteAlternativeId)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Integer quoteAlternativeId;
thing.SetQuoteAlternativeId(quoteAlternativeId);
```

## SetQuoteVersionId(Integer)

```crmscript theme={null}
Void SetQuoteVersionId(Integer quoteVersionId)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Integer quoteVersionId;
thing.SetQuoteVersionId(quoteVersionId);
```

## SetReason(String)

```crmscript theme={null}
Void SetReason(String reason)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String reason;
thing.SetReason(reason);
```

## SetStatus(Integer)

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

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

**Example:**

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

## SetSubTotal(Float)

```crmscript theme={null}
Void SetSubTotal(Float subTotal)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float subTotal;
thing.SetSubTotal(subTotal);
```

## SetTotalPrice(Float)

```crmscript theme={null}
Void SetTotalPrice(Float totalPrice)
```

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

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float totalPrice;
thing.SetTotalPrice(totalPrice);
```

## SetUserValueOverride(Integer)

```crmscript theme={null}
Void SetUserValueOverride(Integer userValueOverride)
```

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

<Note>
  If the user has filled out the discountpercentage field, then the UserValueOverride field is set to OverridePercent. (The DiscountAmount, EarningPercent, EarningAmount and TotalPrice fields are calculated based on the discountPercent.)
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Integer userValueOverride;
thing.SetUserValueOverride(userValueOverride);
```

## SetVAT(Float)

```crmscript theme={null}
Void SetVAT(Float vAT)
```

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

<Note>
  The SuperOffice quote connector will calculate this field based on the vat PERCENTAGES on the individual lines; other connectors may implement other algorithms at will.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
Float vAT;
thing.SetVAT(vAT);
```

## SetVATInfo(String)

```crmscript theme={null}
Void SetVATInfo(String vATInfo)
```

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

<Note>
  This field has no business logic in the CRM code, but is available as a merge field in the quote documents.
</Note>

**Example:**

```crmscript theme={null}
NSQuoteAlternative thing;
String vATInfo;
thing.SetVATInfo(vATInfo);
```


## Related topics

- [NSQuoteAlternativeRecalculated](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAlternativeRecalculated.md)
- [NSQuoteAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAgent.md)
- [Create alternatives](/en/automation/crmscript/howto/quote/add-alternative.md)
- [NSQuote](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuote.md)
- [NSQuoteVersion](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteVersion.md)
- [NSQuoteContext](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteContext.md)
