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

# NSQuotePublishDocuments

> Prepare the documents required to publish a quote - Email, main document as pdf, quoted products as pdf, attachments.

Prepare the documents required to publish a quote - Email, main document as pdf, quoted products as pdf, attachments.

## Constructors

### NSQuotePublishDocuments()

```crmscript theme={null}
NSQuotePublishDocuments
```

Initializes a new instance of the NSQuotePublishDocuments class.

## Methods

## GetErrorMessage()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - If something went wrong, show this message and do not continue.

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String errorMessage = thing.GetErrorMessage();
```

## GetMailBody()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The string that is the content of the mail body; this is the result of merging the mail body template with the current template variable values.

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String mailBody = thing.GetMailBody();
```

## GetMailSubject()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The string that is the mail subject; done by merging the text resource SR\_QUOTE\_PUBLISH\_MAILHEADING with the current template variable values.

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String mailSubject = thing.GetMailSubject();
```

## GetQuoteAttachmentIds()

```crmscript theme={null}
Integer[] GetQuoteAttachmentIds()
```

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer)\[] - Array of IDs of any attachments (standard + custom for this version).

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
Integer[] quoteAttachmentIds = thing.GetQuoteAttachmentIds();
```

## GetQuoteDocumentId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Quote document, as PDF; may be zero if there is no document specified for the version.

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
Integer quoteDocumentId = thing.GetQuoteDocumentId();
```

## GetQuotedProductsId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Quoted products (quote lines or confirmation lines) document, as PDf.

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
Integer quotedProductsId = thing.GetQuotedProductsId();
```

## GetToEmail()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The email address of the recipient, taken from the sale's person.

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String toEmail = thing.GetToEmail();
```

## GetToFullName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The full name of the recipient, taken from the sale's person.

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String toFullName = thing.GetToFullName();
```

## SetErrorMessage(String)

```crmscript theme={null}
Void SetErrorMessage(String errorMessage)
```

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

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String errorMessage;
thing.SetErrorMessage(errorMessage);
```

## SetMailBody(String)

```crmscript theme={null}
Void SetMailBody(String mailBody)
```

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

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String mailBody;
thing.SetMailBody(mailBody);
```

## SetMailSubject(String)

```crmscript theme={null}
Void SetMailSubject(String mailSubject)
```

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

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String mailSubject;
thing.SetMailSubject(mailSubject);
```

## SetQuoteAttachmentIds(Integer\[])

```crmscript theme={null}
Void SetQuoteAttachmentIds(Integer[] quoteAttachmentIds)
```

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

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
Integer[] quoteAttachmentIds;
thing.SetQuoteAttachmentIds(quoteAttachmentIds);
```

## SetQuoteDocumentId(Integer)

```crmscript theme={null}
Void SetQuoteDocumentId(Integer quoteDocumentId)
```

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

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
Integer quoteDocumentId;
thing.SetQuoteDocumentId(quoteDocumentId);
```

## SetQuotedProductsId(Integer)

```crmscript theme={null}
Void SetQuotedProductsId(Integer quotedProductsId)
```

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

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
Integer quotedProductsId;
thing.SetQuotedProductsId(quotedProductsId);
```

## SetToEmail(String)

```crmscript theme={null}
Void SetToEmail(String toEmail)
```

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

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String toEmail;
thing.SetToEmail(toEmail);
```

## SetToFullName(String)

```crmscript theme={null}
Void SetToFullName(String toFullName)
```

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

**Example:**

```crmscript theme={null}
NSQuotePublishDocuments thing;
String toFullName;
thing.SetToFullName(toFullName);
```


## Related topics

- [NSQuoteAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSQuoteAgent.md)
- [SuperOffice.WebApi.Data.QuotePublishDocuments](/en/api/reference/webapi/SuperOffice.WebApi.Data.QuotePublishDocuments.md)
- [Publish](/en/api/reference/restful/agent/userdefinedfieldinfo_agent/publish.md)
- [Send a quote](/en/sale/learn/quote/send.md)
- [Generate Quote Documents](/en/api/reference/restful/agent/quote_agent/generate-quote-documents.md)
- [SuperOffice.WebApi.Agents.QuoteAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.QuoteAgent.md)
