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

# NSAttachmentEntity

## Constructors

### NSAttachmentEntity()

```crmscript theme={null}
NSAttachmentEntity
```

Initializes a new instance of the NSAttachmentEntity class.

## Methods

## GetAttachmentId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The primary key (auto-incremented).

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
Integer attachmentId = thing.GetAttachmentId();
```

## GetAttSize()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The size (in bytes) for the attachment.

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
Integer attSize = thing.GetAttSize();
```

## GetContentId()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The content\_id of this attachment, used for inline images.

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
String contentId = thing.GetContentId();
```

## GetContentType()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The content type for the attachment.

<Note>
  Types can for example be 'application/octet-stream' or 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
</Note>

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
String contentType = thing.GetContentType();
```

## GetInlineImage()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if this attachment is inlined in the html\_body.

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
Bool inlineImage = thing.GetInlineImage();
```

## GetName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The filename for the attachment.

**Example:**

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

## SetAttachmentId(Integer)

```crmscript theme={null}
Void SetAttachmentId(Integer attachmentId)
```

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

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
Integer attachmentId;
thing.SetAttachmentId(attachmentId);
```

## SetAttSize(Integer)

```crmscript theme={null}
Void SetAttSize(Integer attSize)
```

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

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
Integer attSize;
thing.SetAttSize(attSize);
```

## SetContentId(String)

```crmscript theme={null}
Void SetContentId(String contentId)
```

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

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
String contentId;
thing.SetContentId(contentId);
```

## SetContentType(String)

```crmscript theme={null}
Void SetContentType(String contentType)
```

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

<Note>
  Types can for example be 'application/octet-stream' or 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'.
</Note>

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
String contentType;
thing.SetContentType(contentType);
```

## SetInlineImage(Bool)

```crmscript theme={null}
Void SetInlineImage(Bool inlineImage)
```

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

**Example:**

```crmscript theme={null}
NSAttachmentEntity thing;
Bool inlineImage;
thing.SetInlineImage(inlineImage);
```

## SetName(String)

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

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

**Example:**

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


## Related topics

- [NSTicketAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketAgent.md)
- [Get Attachment Entity](/en/api/reference/restful/rest/attachment/get-attachment-entity.md)
- [Post Attachment Entity](/en/api/reference/restful/rest/attachment/post-attachment-entity.md)
- [Default Attachment Entity](/en/api/reference/restful/rest/attachment/default-attachment-entity.md)
- [Put Attachment Entity](/en/api/reference/restful/rest/attachment/put-attachment-entity.md)
- [Save Attachment Entity](/en/api/reference/restful/agent/ticket_agent/save-attachment-entity.md)
