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

# NSQuoteEntity

> Quote methods.

Quote methods.

## Constructors

### NSQuoteEntity()

```crmscript theme={null}
NSQuoteEntity
```

Initializes a new instance of the NSQuoteEntity 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}
NSQuoteEntity thing;
Integer acceptedQuoteAlternativeId = thing.GetAcceptedQuoteAlternativeId();
```

## 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}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity thing;
String eRPQuoteKey = thing.GetERPQuoteKey();
```

## 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}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity thing;
Integer quoteConnectionId = thing.GetQuoteConnectionId();
```

## GetQuoteId()

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

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

**Example:**

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

## GetQuoteVersions()

```crmscript theme={null}
NSQuoteVersion[] GetQuoteVersions()
```

**Returns:** [CRMScript.NetServer.NSQuoteVersion](CRMScript.NetServer.NSQuoteVersion)\[] - Array og QuoteVersions connected to the quote.

**Example:**

```crmscript theme={null}
NSQuoteEntity thing;
NSQuoteVersion[] quoteVersions = thing.GetQuoteVersions();
```

## GetSaleId()

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

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

**Example:**

```crmscript theme={null}
NSQuoteEntity 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}
NSQuoteEntity thing;
Integer useValuesFromQuote = thing.GetUseValuesFromQuote();
```

## SetAcceptedQuoteAlternativeId(Integer)

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

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

**Example:**

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

## 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}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity thing;
String eRPQuoteKey;
thing.SetERPQuoteKey(eRPQuoteKey);
```

## SetOrderComment(String)

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

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

**Example:**

```crmscript theme={null}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity 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}
NSQuoteEntity thing;
Integer quoteId;
thing.SetQuoteId(quoteId);
```

## SetQuoteVersions(NSQuoteVersion\[])

```crmscript theme={null}
Void SetQuoteVersions(NSQuoteVersion[] quoteVersions)
```

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

**Example:**

```crmscript theme={null}
NSQuoteEntity thing;
NSQuoteVersion[] quoteVersions;
thing.SetQuoteVersions(quoteVersions);
```

## SetSaleId(Integer)

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

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

**Example:**

```crmscript theme={null}
NSQuoteEntity 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}
NSQuoteEntity thing;
Integer useValuesFromQuote;
thing.SetUseValuesFromQuote(useValuesFromQuote);
```


## Related topics

- [NSQuoteAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAgent.md)
- [Retrieve quote info](/en/automation/crmscript/howto/quote/get.md)
- [Create quote](/en/automation/crmscript/howto/quote/create.md)
- [Save Quote Entity](/en/api/reference/restful/agent/quote_agent/save-quote-entity.md)
- [Get Quote Entity](/en/api/reference/restful/agent/quote_agent/get-quote-entity.md)
- [Get Quote Entity From Sale Id](/en/api/reference/restful/agent/quote_agent/get-quote-entity-from-sale-id.md)
