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

# NSDocumentTemplateEntity

> The template a document is based on is stored in the SO arc\template folder on the server. This will return the name as displayed in the GUI, and not the physical document name, of the template the document object is based on.

The template a document is based on is stored in the SO\_arc\template folder on the server. This will return the name as displayed in the GUI, and not the physical document name, of the template the document object is based on.

## Constructors

### NSDocumentTemplateEntity()

```crmscript theme={null}
NSDocumentTemplateEntity
```

Initializes a new instance of the NSDocumentTemplateEntity class.

## Methods

## GetAutoeventId()

Which document plugin is responsible for the documents generated from this template

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer autoeventId = thing.GetAutoeventId();
```

## GetDefaultOref()

Processed via tag substitution to give document reference

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String defaultOref = thing.GetDefaultOref();
```

## GetDeleted()

True if deleted

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

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

**Example:**

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

## GetDirection()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - 1 = incoming, 2 = outgoing. See \<xref href="CRMScript.NetServer.TaskDirection" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer direction = thing.GetDirection();
```

## GetDocumentTemplateId()

Primary key

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer documentTemplateId = thing.GetDocumentTemplateId();
```

## GetDocumentTypeKey()

The document type to use when creating a blank document. Plugin-specific. Used when not creating template from a local file.

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer documentTypeKey = thing.GetDocumentTypeKey();
```

## GetEmailSubject()

Subject to use if document template is an email.

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String emailSubject = thing.GetEmailSubject();
```

## GetFilename()

Relative to TemplatePath, or extref for other document plugins. i.e URL or full path.

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String filename = thing.GetFilename();
```

## GetIncludeSignature()

True if the email signature should be added in bottom of mail if this an email template

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Bool includeSignature = thing.GetIncludeSignature();
```

## GetIntentId()

What is the intention of this document (used by SAINT)

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer intentId = thing.GetIntentId();
```

## GetInvitationDocType()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Type for sending email meeting invitation. See \<xref href="CRMScript.NetServer.DocTmplInvitationType" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer invitationDocType = thing.GetInvitationDocType();
```

## GetIsDefaultPublished()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Published to external persons.

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Bool isDefaultPublished = thing.GetIsDefaultPublished();
```

## GetIsInUseInGuides()

True if the template is in use in a project or sales guide

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Bool isInUseInGuides = thing.GetIsInUseInGuides();
```

## GetLoadTemplateFromPlugin()

Which document plugin is responsible for this template's contents

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer loadTemplateFromPlugin = thing.GetLoadTemplateFromPlugin();
```

## GetMimeType()

The mime type

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String mimeType = thing.GetMimeType();
```

## GetName()

The template list item

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

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

**Example:**

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

## GetPrivacyDocType()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Indicator that this document template has a functional role, related to privacy/GDPR. See \<xref href="CRMScript.NetServer.DocTmplPrivacyType" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer privacyDocType = thing.GetPrivacyDocType();
```

## GetQuoteDocType()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The role this document plays in the Quote system, if any. See \<xref href="CRMScript.NetServer.DocTmplQuoteType" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer quoteDocType = thing.GetQuoteDocType();
```

## GetRank()

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

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

**Example:**

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

## GetRecordType()

```crmscript theme={null}
NSDocTmplType GetRecordType()
```

**Returns:** [CRMScript.NetServer.NSDocTmplType](CRMScript.NetServer.NSDocTmplType) - 1 = app, 2 = doc, 3 = email, 4 = fax, 5 = phone, 6 = todo See \<xref href="CRMScript.NetServer.TaskType" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
NSDocTmplType recordType = thing.GetRecordType();
```

## GetSaveInDb()

1 = save document records in DB; otherwise not.

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer saveInDb = thing.GetSaveInDb();
```

## GetSenderEmailAddress()

If email template, default sender address when template is of type quote email or privacy email.

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String senderEmailAddress = thing.GetSenderEmailAddress();
```

## GetSenderEmailMode()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - If email template, when DocType is Privacy or quote email, it is possible to make sender address like our contact, or our support contact, or always one address. See \<xref href="CRMScript.NetServer.SenderMailMode" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer senderEmailMode = thing.GetSenderEmailMode();
```

## GetShowCurrents()

True if when using this template there should be shown a place for editing current choices of person, compant, sale, project etc

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

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Bool showCurrents = thing.GetShowCurrents();
```

## GetTooltip()

Tooltip or other description

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

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

**Example:**

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

## SetAutoeventId(Integer)

Which document plugin is responsible for the documents generated from this template

```crmscript theme={null}
Void SetAutoeventId(Integer autoeventId)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer autoeventId;
thing.SetAutoeventId(autoeventId);
```

## SetDefaultOref(String)

Processed via tag substitution to give document reference

```crmscript theme={null}
Void SetDefaultOref(String defaultOref)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String defaultOref;
thing.SetDefaultOref(defaultOref);
```

## SetDeleted(Bool)

True if deleted

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

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

**Example:**

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

## SetDirection(Integer)

Sets the direction of a document template.

```crmscript theme={null}
Void SetDirection(Integer direction)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer direction;
thing.SetDirection(direction);
```

## SetDocumentTemplateId(Integer)

Primary key

```crmscript theme={null}
Void SetDocumentTemplateId(Integer documentTemplateId)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer documentTemplateId;
thing.SetDocumentTemplateId(documentTemplateId);
```

## SetDocumentTypeKey(Integer)

The document type to use when creating a blank document. Plugin-specific. Used when not creating template from a local file.

```crmscript theme={null}
Void SetDocumentTypeKey(Integer documentTypeKey)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer documentTypeKey;
thing.SetDocumentTypeKey(documentTypeKey);
```

## SetEmailSubject(String)

Subject to use if document template is an email.

```crmscript theme={null}
Void SetEmailSubject(String emailSubject)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String emailSubject;
thing.SetEmailSubject(emailSubject);
```

## SetFilename(String)

Relative to TemplatePath, or extref for other document plugins. i.e URL or full path.

```crmscript theme={null}
Void SetFilename(String filename)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String filename;
thing.SetFilename(filename);
```

## SetIncludeSignature(Bool)

True if the email signature should be added in bottom of mail if this an email template

```crmscript theme={null}
Void SetIncludeSignature(Bool includeSignature)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Bool includeSignature;
thing.SetIncludeSignature(includeSignature);
```

## SetIntentId(Integer)

What is the intention of this document (used by SAINT)

```crmscript theme={null}
Void SetIntentId(Integer intentId)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer intentId;
thing.SetIntentId(intentId);
```

## SetInvitationDocType(Integer)

```crmscript theme={null}
Void SetInvitationDocType(Integer invitationDocType)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer invitationDocType;
thing.SetInvitationDocType(invitationDocType);
```

## SetIsDefaultPublished(Bool)

Published to external persons

```crmscript theme={null}
Void SetIsDefaultPublished(Bool isDefaultPublished)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Bool isDefaultPublished;
thing.SetIsDefaultPublished(isDefaultPublished);
```

## SetIsInUseInGuides(Bool)

True if the template is in use in a project or sales guide

```crmscript theme={null}
Void SetIsInUseInGuides(Bool isInUseInGuides)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Bool isInUseInGuides;
thing.SetIsInUseInGuides(isInUseInGuides);
```

## SetLoadTemplateFromPlugin(Integer)

Which document plugin is responsible for this template's contents

```crmscript theme={null}
Void SetLoadTemplateFromPlugin(Integer loadTemplateFromPlugin)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer loadTemplateFromPlugin;
thing.SetLoadTemplateFromPlugin(loadTemplateFromPlugin);
```

## SetMimeType(String)

The mime type

```crmscript theme={null}
Void SetMimeType(String mimeType)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String mimeType;
thing.SetMimeType(mimeType);
```

## SetName(String)

The template list item

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

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

**Example:**

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

## SetPrivacyDocType(Integer)

```crmscript theme={null}
Void SetPrivacyDocType(Integer privacyDocType)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer privacyDocType;
thing.SetPrivacyDocType(privacyDocType);
```

## SetQuoteDocType(Integer)

```crmscript theme={null}
Void SetQuoteDocType(Integer quoteDocType)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer quoteDocType;
thing.SetQuoteDocType(quoteDocType);
```

## SetRank(Integer)

Rank order

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

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

**Example:**

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

## SetRecordType(NSDocTmplType)

1 = app, 2 = doc, 3 = email, 4 = fax, 5 = phone, 6 = todo

```crmscript theme={null}
Void SetRecordType(NSDocTmplType recordType)
```

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

<Note>
  See \<xref href="CRMScript.NetServer.TaskType" data-throw-if-not-resolved="false">\</xref>
</Note>

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
NSDocTmplType recordType;
thing.SetRecordType(recordType);
```

## SetSaveInDb(Integer)

1 = save document records in DB; otherwise not.

```crmscript theme={null}
Void SetSaveInDb(Integer saveInDb)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer saveInDb;
thing.SetSaveInDb(saveInDb);
```

## SetSenderEmailAddress(String)

If email template, default senderaddress when template is of type quote email or privacy email.

```crmscript theme={null}
Void SetSenderEmailAddress(String senderEmailAddress)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
String senderEmailAddress;
thing.SetSenderEmailAddress(senderEmailAddress);
```

## SetSenderEmailMode(Integer)

```crmscript theme={null}
Void SetSenderEmailMode(Integer senderEmailMode)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Integer senderEmailMode;
thing.SetSenderEmailMode(senderEmailMode);
```

## SetShowCurrents(Bool)

True if when using this template there should be shown a place for editing current choices of person, compant, sale, project etc

```crmscript theme={null}
Void SetShowCurrents(Bool showCurrents)
```

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

**Example:**

```crmscript theme={null}
NSDocumentTemplateEntity thing;
Bool showCurrents;
thing.SetShowCurrents(showCurrents);
```

## SetTooltip(String)

Tooltip or other description

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

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

**Example:**

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


## Related topics

- [Document templates](/en/automation/crmscript/howto/document/templates.md)
- [NSListAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSListAgent.md)
- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [Put Document Template Entity](/en/api/reference/restful/rest/list_documenttemplate/put-document-template-entity.md)
- [Delete Document Template Entity](/en/api/reference/restful/rest/list_documenttemplate/delete-document-template-entity.md)
- [Post Document Template Entity](/en/api/reference/restful/rest/list_documenttemplate/post-document-template-entity.md)
