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

# NSContactRelationEntity

> Relationship between a (contact/person) and another (contact/person), as described by the RelationDefinition.

Relationship between a (contact/person) and another (contact/person), as described by the RelationDefinition.

## Constructors

### NSContactRelationEntity()

```crmscript theme={null}
NSContactRelationEntity
```

Initializes a new instance of the NSContactRelationEntity class.

## Methods

## GetActiveText()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Active text for the relation.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String activeText = thing.GetActiveText();
```

## GetComment()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Comment for relation.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String comment = thing.GetComment();
```

## GetCreatedBy()

```crmscript theme={null}
NSAssociate GetCreatedBy()
```

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate)

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
NSAssociate createdBy = thing.GetCreatedBy();
```

## GetCreatedDate()

```crmscript theme={null}
DateTime GetCreatedDate()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Registered when.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
DateTime createdDate = thing.GetCreatedDate();
```

## GetDestinationContactId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of the destination contact. The value is mandatory.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer destinationContactId = thing.GetDestinationContactId();
```

## GetDestinationContactName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of the destination contact.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String destinationContactName = thing.GetDestinationContactName();
```

## GetDestinationPersonId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of the destination person. The value is not mandatory. The person must belong to the destination contact.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer destinationPersonId = thing.GetDestinationPersonId();
```

## GetDestinationPersonName()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Name of the destination person.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String destinationPersonName = thing.GetDestinationPersonName();
```

## GetPassiveText()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Passive text for the relation.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String passiveText = thing.GetPassiveText();
```

## GetRelationDefinitionId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Reference to definition.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer relationDefinitionId = thing.GetRelationDefinitionId();
```

## GetRelationId()

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

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer relationId = thing.GetRelationId();
```

## GetReversed()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Is direction reversed relative to definition.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer reversed = thing.GetReversed();
```

## GetSourceContactId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of the source contact. The value is mandatory.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer sourceContactId = thing.GetSourceContactId();
```

## GetSourceContactName()

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

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String sourceContactName = thing.GetSourceContactName();
```

## GetSourcePersonId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of the source person. The value is not mandatory. The person must belong to the source contact.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer sourcePersonId = thing.GetSourcePersonId();
```

## GetSourcePersonName()

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

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String sourcePersonName = thing.GetSourcePersonName();
```

## GetUpdatedBy()

```crmscript theme={null}
NSAssociate GetUpdatedBy()
```

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate)

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
NSAssociate updatedBy = thing.GetUpdatedBy();
```

## GetUpdatedDate()

```crmscript theme={null}
DateTime GetUpdatedDate()
```

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Last updated when.

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
DateTime updatedDate = thing.GetUpdatedDate();
```

## SetActiveText(String)

```crmscript theme={null}
Void SetActiveText(String activeText)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String activeText;
thing.SetActiveText(activeText);
```

## SetComment(String)

```crmscript theme={null}
Void SetComment(String comment)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String comment;
thing.SetComment(comment);
```

## SetCreatedBy(NSAssociate)

```crmscript theme={null}
Void SetCreatedBy(NSAssociate createdBy)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
NSAssociate createdBy;
thing.SetCreatedBy(createdBy);
```

## SetCreatedDate(DateTime)

```crmscript theme={null}
Void SetCreatedDate(DateTime createdDate)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
DateTime createdDate;
thing.SetCreatedDate(createdDate);
```

## SetDestinationContactId(Integer)

```crmscript theme={null}
Void SetDestinationContactId(Integer destinationContactId)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer destinationContactId;
thing.SetDestinationContactId(destinationContactId);
```

## SetDestinationContactName(String)

```crmscript theme={null}
Void SetDestinationContactName(String destinationContactName)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String destinationContactName;
thing.SetDestinationContactName(destinationContactName);
```

## SetDestinationPersonId(Integer)

```crmscript theme={null}
Void SetDestinationPersonId(Integer destinationPersonId)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer destinationPersonId;
thing.SetDestinationPersonId(destinationPersonId);
```

## SetDestinationPersonName(String)

```crmscript theme={null}
Void SetDestinationPersonName(String destinationPersonName)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String destinationPersonName;
thing.SetDestinationPersonName(destinationPersonName);
```

## SetPassiveText(String)

```crmscript theme={null}
Void SetPassiveText(String passiveText)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String passiveText;
thing.SetPassiveText(passiveText);
```

## SetRelationDefinitionId(Integer)

```crmscript theme={null}
Void SetRelationDefinitionId(Integer relationDefinitionId)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer relationDefinitionId;
thing.SetRelationDefinitionId(relationDefinitionId);
```

## SetRelationId(Integer)

```crmscript theme={null}
Void SetRelationId(Integer relationId)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer relationId;
thing.SetRelationId(relationId);
```

## SetReversed(Integer)

```crmscript theme={null}
Void SetReversed(Integer reversed)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer reversed;
thing.SetReversed(reversed);
```

## SetSourceContactId(Integer)

```crmscript theme={null}
Void SetSourceContactId(Integer sourceContactId)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer sourceContactId;
thing.SetSourceContactId(sourceContactId);
```

## SetSourceContactName(String)

```crmscript theme={null}
Void SetSourceContactName(String sourceContactName)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String sourceContactName;
thing.SetSourceContactName(sourceContactName);
```

## SetSourcePersonId(Integer)

```crmscript theme={null}
Void SetSourcePersonId(Integer sourcePersonId)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
Integer sourcePersonId;
thing.SetSourcePersonId(sourcePersonId);
```

## SetSourcePersonName(String)

```crmscript theme={null}
Void SetSourcePersonName(String sourcePersonName)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
String sourcePersonName;
thing.SetSourcePersonName(sourcePersonName);
```

## SetUpdatedBy(NSAssociate)

```crmscript theme={null}
Void SetUpdatedBy(NSAssociate updatedBy)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
NSAssociate updatedBy;
thing.SetUpdatedBy(updatedBy);
```

## SetUpdatedDate(DateTime)

```crmscript theme={null}
Void SetUpdatedDate(DateTime updatedDate)
```

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

**Example:**

```crmscript theme={null}
NSContactRelationEntity thing;
DateTime updatedDate;
thing.SetUpdatedDate(updatedDate);
```


## Related topics

- [NSRelationAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSRelationAgent.md)
- [Namespace CRMScript.NetServer](/en/automation/crmscript/reference/CRMScript.NetServer.md)
- [Delete Contact Relation Entity](/en/api/reference/restful/rest/contactrelation/delete-contact-relation-entity.md)
- [Get Contact Relation Entity](/en/api/reference/restful/rest/contactrelation/get-contact-relation-entity.md)
- [Post Contact Relation Entity](/en/api/reference/restful/rest/contactrelation/post-contact-relation-entity.md)
- [Default Contact Relation Entity](/en/api/reference/restful/rest/contactrelation/default-contact-relation-entity.md)
