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

# NSQuote

> Quote carrier with the active quote version and favorite alternative.

Quote carrier with the active quote version and favorite alternative.

## Constructors

### NSQuote()

```crmscript theme={null}
NSQuote
```

Initializes a new instance of the NSQuote class.

## Methods

## GetAcceptedQuoteAlternativeId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The primary key of the Quote Alternative which was finally accepted by the customer.

<Note>
  Set when the user is marking a quote as accepted.
</Note>

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer acceptedQuoteAlternativeId = thing.GetAcceptedQuoteAlternativeId();
```

## GetActiveQuoteVersion()

```crmscript theme={null}
NSQuoteVersion GetActiveQuoteVersion()
```

**Returns:** [CRMScript.NetServer.NSQuoteVersion](CRMScript.NetServer.NSQuoteVersion) - The active quote version for the quote.

**Example:**

```crmscript theme={null}
NSQuote thing;
NSQuoteVersion activeQuoteVersion = thing.GetActiveQuoteVersion();
```

## GetActiveQuoteVersionId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The primary key of the Quote Version that is currently active.

<Note>
  The active version will always be the latest version.
</Note>

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer activeQuoteVersionId = thing.GetActiveQuoteVersionId();
```

## GetDocumentId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The ID of the main Quote Document.

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer documentId = thing.GetDocumentId();
```

## GetERPOrderKey()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The key in the ERP system that identifies this sale's Order, as transferred and possibly later edited in the ERP system.

<Note>
  Only filled out if there exists a corresponding order representation of the quote in the ERP system.
</Note>

**Example:**

```crmscript theme={null}
NSQuote thing;
String eRPOrderKey = thing.GetERPOrderKey();
```

## GetERPQuoteKey()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Foreign key of quote (if available). The key in the ERP system that identifies this sale's Quote (as opposed to the later Order information).

**Example:**

```crmscript theme={null}
NSQuote thing;
String eRPQuoteKey = thing.GetERPQuoteKey();
```

## GetFavoriteQuoteAlternative()

```crmscript theme={null}
NSQuoteAlternative GetFavoriteQuoteAlternative()
```

**Returns:** [CRMScript.NetServer.NSQuoteAlternative](CRMScript.NetServer.NSQuoteAlternative) - The favorite quote alternative for the quote and active quote version.

**Example:**

```crmscript theme={null}
NSQuote thing;
NSQuoteAlternative favoriteQuoteAlternative = thing.GetFavoriteQuoteAlternative();
```

## GetOrderComment()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - A comment that is intended for the Invoice, Order, Packing list and similar stages AFTER the quote has become an order and goes to ERP for processing.

**Example:**

```crmscript theme={null}
NSQuote thing;
String orderComment = thing.GetOrderComment();
```

## GetPoNumber()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Customer's Purchase order number.

**Example:**

```crmscript theme={null}
NSQuote thing;
String poNumber = thing.GetPoNumber();
```

## GetPreferredEmailCulture()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - When emails are sent (offer or confirmation), a language can be chosen in the GUI; this field saves the most recent choice and can be used to default the next such choice. Default-default is user's current language.

**Example:**

```crmscript theme={null}
NSQuote thing;
String preferredEmailCulture = thing.GetPreferredEmailCulture();
```

## GetQuoteConnectionId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The connection in the CRM system to where this quote came from. Identifies the ERP connection used for this quote. Each quote is bound to one and only one connection.

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer quoteConnectionId = thing.GetQuoteConnectionId();
```

## GetQuoteId()

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

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

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer quoteId = thing.GetQuoteId();
```

## GetSaleId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The foreign key to the corresponding sale.

**Example:**

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

## GetUseValuesFromQuote()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - If true, then the Earning, Earning\_Percent and Amount fields are populated from the QuoteVersion.QuoteAlternative (current revision, most-likely alternative).

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer useValuesFromQuote = thing.GetUseValuesFromQuote();
```

## SetAcceptedQuoteAlternativeId(Integer)

```crmscript theme={null}
Void SetAcceptedQuoteAlternativeId(Integer acceptedQuoteAlternativeId)
```

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

<Note>
  Set when the user is marking a quote as accepted.
</Note>

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer acceptedQuoteAlternativeId;
thing.SetAcceptedQuoteAlternativeId(acceptedQuoteAlternativeId);
```

## SetActiveQuoteVersion(NSQuoteVersion)

```crmscript theme={null}
Void SetActiveQuoteVersion(NSQuoteVersion activeQuoteVersion)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
NSQuoteVersion activeQuoteVersion;
thing.SetActiveQuoteVersion(activeQuoteVersion);
```

## SetActiveQuoteVersionId(Integer)

```crmscript theme={null}
Void SetActiveQuoteVersionId(Integer activeQuoteVersionId)
```

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

<Note>
  The active version will always be the latest version.
</Note>

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer activeQuoteVersionId;
thing.SetActiveQuoteVersionId(activeQuoteVersionId);
```

## SetDocumentId(Integer)

```crmscript theme={null}
Void SetDocumentId(Integer documentId)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer documentId;
thing.SetDocumentId(documentId);
```

## SetERPOrderKey(String)

```crmscript theme={null}
Void SetERPOrderKey(String eRPOrderKey)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
String eRPOrderKey;
thing.SetERPOrderKey(eRPOrderKey);
```

## SetERPQuoteKey(String)

```crmscript theme={null}
Void SetERPQuoteKey(String eRPQuoteKey)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
String eRPQuoteKey;
thing.SetERPQuoteKey(eRPQuoteKey);
```

## SetFavoriteQuoteAlternative(NSQuoteAlternative)

```crmscript theme={null}
Void SetFavoriteQuoteAlternative(NSQuoteAlternative favoriteQuoteAlternative)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
NSQuoteAlternative favoriteQuoteAlternative;
thing.SetFavoriteQuoteAlternative(favoriteQuoteAlternative);
```

## SetOrderComment(String)

```crmscript theme={null}
Void SetOrderComment(String orderComment)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
String orderComment;
thing.SetOrderComment(orderComment);
```

## SetPoNumber(String)

```crmscript theme={null}
Void SetPoNumber(String poNumber)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
String poNumber;
thing.SetPoNumber(poNumber);
```

## SetPreferredEmailCulture(String)

```crmscript theme={null}
Void SetPreferredEmailCulture(String preferredEmailCulture)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
String preferredEmailCulture;
thing.SetPreferredEmailCulture(preferredEmailCulture);
```

## SetQuoteConnectionId(Integer)

```crmscript theme={null}
Void SetQuoteConnectionId(Integer quoteConnectionId)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer quoteConnectionId;
thing.SetQuoteConnectionId(quoteConnectionId);
```

## SetQuoteId(Integer)

```crmscript theme={null}
Void SetQuoteId(Integer quoteId)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer quoteId;
thing.SetQuoteId(quoteId);
```

## SetSaleId(Integer)

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

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

**Example:**

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

## SetUseValuesFromQuote(Integer)

```crmscript theme={null}
Void SetUseValuesFromQuote(Integer useValuesFromQuote)
```

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

**Example:**

```crmscript theme={null}
NSQuote thing;
Integer useValuesFromQuote;
thing.SetUseValuesFromQuote(useValuesFromQuote);
```


## Related topics

- [NSQuoteAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAgent.md)
- [NSQuoteContext](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteContext.md)
- [NSQuoteEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteEntity.md)
- [NSQuoteLine](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteLine.md)
- [NSQuoteVersion](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteVersion.md)
- [NSQuoteAlternative](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAlternative.md)
