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

# NSConsentSource

> Carrier object for ConsentSource.

Carrier object for ConsentSource.

## Constructors

### NSConsentSource()

```crmscript theme={null}
NSConsentSource
```

Initializes a new instance of the NSConsentSource class.

## Methods

## GetConsentSourceId()

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

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

**Example:**

```crmscript theme={null}
NSConsentSource thing;
Integer consentSourceId = thing.GetConsentSourceId();
```

## GetDeleted()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - true if the NSConsentSource is deleted.

**Example:**

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

## GetKey()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - The key used to uniquely identify this consent source.

**Example:**

```crmscript theme={null}
NSConsentSource thing;
String key = thing.GetKey();
```

## GetMailTemplateId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The mail template to use when automatically sending emails to new persons created with this consent source.

**Example:**

```crmscript theme={null}
NSConsentSource thing;
Integer mailTemplateId = thing.GetMailTemplateId();
```

## GetName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of consent source.

**Example:**

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

## GetRank()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Rank of this consent source.

**Example:**

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

## GetTooltip()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Tooltip for this consent source.

**Example:**

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

## SetConsentSourceId(Integer)

```crmscript theme={null}
Void SetConsentSourceId(Integer consentSourceId)
```

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

**Example:**

```crmscript theme={null}
NSConsentSource thing;
Integer consentSourceId;
thing.SetConsentSourceId(consentSourceId);
```

## SetDeleted(Bool)

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

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

**Example:**

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

## SetKey(String)

```crmscript theme={null}
Void SetKey(String key)
```

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

**Example:**

```crmscript theme={null}
NSConsentSource thing;
String key;
thing.SetKey(key);
```

## SetMailTemplateId(Integer)

```crmscript theme={null}
Void SetMailTemplateId(Integer mailTemplateId)
```

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

**Example:**

```crmscript theme={null}
NSConsentSource thing;
Integer mailTemplateId;
thing.SetMailTemplateId(mailTemplateId);
```

## SetName(String)

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

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

**Example:**

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

## SetRank(Integer)

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

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

**Example:**

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

## SetTooltip(String)

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

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

**Example:**

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


## Related topics

- [NSConsentPerson](/en/automation/crmscript/reference/CRMScript.NetServer.NSConsentPerson.md)
- [NSConsentInfo](/en/automation/crmscript/reference/CRMScript.NetServer.NSConsentInfo.md)
- [NSListAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSListAgent.md)
- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [Save Consent Source](/en/api/reference/restful/agent/list_agent/save-consent-source.md)
- [Put Consent Source](/en/api/reference/restful/rest/list_consentsource/put-consent-source.md)
