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

# NSAppointmentEntity

> Appointments appear in the diary, and have links to a Contact/Person and possibly a Project or Sale. They have start and end time+date.

Appointments appear in the diary, and have links to a Contact/Person and possibly a Project or Sale. They have start and end time+date.

## Constructors

### NSAppointmentEntity()

```crmscript theme={null}
NSAppointmentEntity
```

Initializes a new instance of the NSAppointmentEntity class.

## Methods

## GetActiveDate()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - The date to be used for searching and showing.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
DateTime activeDate = thing.GetActiveDate();
```

## GetActiveLinks()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Number of active links to sale, document, appointment.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer activeLinks = thing.GetActiveLinks();
```

## GetAlarmLeadTime()

```crmscript theme={null}
TimeSpan GetAlarmLeadTime()
```

**Returns:** [CRMScript.Native.TimeSpan](CRMScript.Native.TimeSpan) - Alarm lead time.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
TimeSpan alarmLeadTime = thing.GetAlarmLeadTime();
```

## GetAlldayEvent()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if this is an all day event.

## GetAppointmentId()

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

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer appointmentId = thing.GetAppointmentId();
```

## GetAssignedBy()

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

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate) - Who assigned this appointment to this user? Whose diary did the appointment come from?

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSAssociate assignedBy = thing.GetAssignedBy();
```

## GetAssignmentStatus()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Status if this appointment is in the process of being assigned to someone else.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer assignmentStatus = thing.GetAssignmentStatus();
```

## GetAssociate()

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

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate) - The owner of the appointment - the associate whose diary/checklist the appointment is in.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSAssociate associate = thing.GetAssociate();
```

## GetAgenda()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Agenda for the appointment.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String agenda = thing.GetAgenda();
```

## GetBookingType()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The type of booking the appointment represents.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer bookingType = thing.GetBookingType();
```

## GetCautionWarning()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Status field to indicate appointments that have some sort of problem. See \<xref href="CRMScript.NetServer.AppointmentCautionWarning" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer cautionWarning = thing.GetCautionWarning();
```

## GetCentralserviceVideomeetId()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - GUID for video meeting in central services.

<Note>
  This is set when we create meetings from SuperOffice. It is blank for incoming meetings created from inbox.
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String centralserviceVideomeetId = thing.GetCentralserviceVideomeetId();
```

## GetColorIndex()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Appointment colour, used only in Japanese versions. Western versions take colour from Task. See \<xref href="CRMScript.NetServer.ColorIndex" data-throw-if-not-resolved="false">\</xref>.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer colorIndex = thing.GetColorIndex();
```

## GetCompleted()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Appointment Completed state.

<Note>
  This property is the part of the Status property that is the completed state. Could be three state if the three state user preference is set.
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer completed = thing.GetCompleted();
```

## GetContact()

```crmscript theme={null}
NSContact GetContact()
```

**Returns:** [CRMScript.NetServer.NSContact](CRMScript.NetServer.NSContact) - The contact associated with the appointment. It may also be null if no contact is associated with the appointment.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSContact contact = thing.GetContact();
```

## GetCreatedBy()

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

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate) - The associate that first created the appointment.

<Note>
  The property is read-only.
</Note>

**Example:**

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

## GetCreatedDate()

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

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

**Example:**

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

## GetCustomFields()

Gets the user-defined + extra fields on an NSAppointmentEntity as a map.

```crmscript theme={null}
Map GetCustomFields()
```

**Returns:** [CRMScript.Native.Map](CRMScript.Native.Map) - Map containing user defined and extra field values by field name.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Map fields = thing.GetCustomFields();
String oldValue = fields.get("SuperOffice:1");
fields.insert("SuperOffice:1", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
  printLine(fields.getKey() + ":  " + fields.getVal());
```

## GetDescription()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Description of the appointment.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String description = thing.GetDescription();
```

## GetEndDate()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Date + end time planned.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
DateTime endDate = thing.GetEndDate();
```

## GetExtraFields()

Gets the extra fields on NSAppointmentEntity as a map.

```crmscript theme={null}
Map GetExtraFields()
```

**Returns:** [CRMScript.Native.Map](CRMScript.Native.Map) - Map containing extra field values by field name.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Map fields = thing.GetExtraFields();
String oldValue = fields.get("x_foobar");
fields.insert("x_foobar", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
  printLine(fields.getKey() + ":  " + fields.getVal());
```

## GetFreeBusy()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - What kind of time is this? False is Busy. True is Free.

## GetHasAlarm()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Does this appointment have an alarm?

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool hasAlarm = thing.GetHasAlarm();
```

## GetHasConflict()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Does the appointment overlap with another appointment in the user's diary?

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool hasConflict = thing.GetHasConflict();
```

## GetInternalNotes()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Internal notes for the appointment.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String notes = thing.GetInternalNotes();
```

## GetInvitationStatus()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Status if this appointment represents an invitation.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer invitationStatus = thing.GetInvitationStatus();
```

## GetInvitedPerson()

```crmscript theme={null}
NSPerson GetInvitedPerson()
```

**Returns:** [CRMScript.NetServer.NSPerson](CRMScript.NetServer.NSPerson) - If the appointment is a booking, the invited persons may be your associates, but you are also able to invite contact persons from other companies to join your meeting. They do not receive an invitation, unless you send them one by email, but you can see in the appointment that persons other than your associates have been invited to a meeting. Each invited person will have an appointment slave record.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSPerson invitedPerson = thing.GetInvitedPerson();
```

## GetIsAlldayEvent()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if all day event.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool isAlldayEvent = thing.GetIsAlldayEvent();
```

## GetIsFree()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - True if free, false if busy.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool isFree = thing.GetIsFree();
```

## GetIsMileStone()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Is this appointment a milestone?

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool isMileStone = thing.GetIsMileStone();
```

## GetIsPublished()

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

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - Should this NSAppointmentEntity be published and visible to strangers?

## GetJoinVideomeetUrl()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Blank when not a video meeting. Filled with Join Meeting URL when created.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String joinVideomeetUrl = thing.GetJoinVideomeetUrl();
```

## GetLagTime()

```crmscript theme={null}
TimeSpan GetLagTime()
```

**Returns:** [CRMScript.Native.TimeSpan](CRMScript.Native.TimeSpan) - As leadtime, but after the end - time blocked for travel and so on.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
TimeSpan lagTime = thing.GetLagTime();
```

## GetLeadTime()

```crmscript theme={null}
TimeSpan GetLeadTime()
```

**Returns:** [CRMScript.Native.TimeSpan](CRMScript.Native.TimeSpan) - Time blocked (minutes) BEFORE starttime.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
TimeSpan leadTime = thing.GetLeadTime();
```

## GetLinks()

```crmscript theme={null}
NSLink[] GetLinks()
```

**Returns:** [CRMScript.NetServer.NSLink](CRMScript.NetServer.NSLink)\[] - List of all elements linked to the appointment.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSLink[] links = thing.GetLinks();
```

## GetLocation()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Location for appointment, defaulted from invited resource of type place and other rules, but you can write anything you want here.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String location = thing.GetLocation();
```

## GetMotherAssociate()

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

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate) - The owner of the mother appointment - the associate whose diary/checklist the mother appointment is in.

<Note>
  The mother appointment is the one identified by the mother\_id. If the mother\_id is 0 or the same as this appointment\_id, then the master associate will be the same as the 'ordinary' associate.
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSAssociate motherAssociate = thing.GetMotherAssociate();
```

## GetMotherId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - ID of mother appointment; self if booking master, master ID if booking slave, 0 if normal appointment. However, if 0 and assoc\_id != reg\_id then this is an assigned appointment, indicated vt type = kBooking.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer motherId = thing.GetMotherId();
```

## GetParticipants()

```crmscript theme={null}
NSParticipantInfo[] GetParticipants()
```

**Returns:** [CRMScript.NetServer.NSParticipantInfo](CRMScript.NetServer.NSParticipantInfo)\[] - List of IDs of the participants to this appointment.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSParticipantInfo[] participants = thing.GetParticipants();
```

## GetPerson()

```crmscript theme={null}
NSPerson GetPerson()
```

**Returns:** [CRMScript.NetServer.NSPerson](CRMScript.NetServer.NSPerson) - An appointment may also be connected to a person; this must be a contact person registered on the current company. This does not mean however that a person is required.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSPerson person = thing.GetPerson();
```

## GetPreferredTZLocation()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Appointment's preferred timezone location.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer preferredTZLocation = thing.GetPreferredTZLocation();
```

## GetPriority()

It's possible to give appointments different priorities. All the different priority types are saved in the priority table, and edited from the Admin Client. An appointment does not require a priority.

```crmscript theme={null}
NSPriority GetPriority()
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSPriority priority = thing.GetPriority();
```

## GetPrivate()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The confidentiality of appointments is shown as different types of private on the appointment. See \<xref href="CRMScript.NetServer.AppointmentPrivate" data-throw-if-not-resolved="false">\</xref>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer private = thing.GetPrivate();
```

## GetProject()

```crmscript theme={null}
NSProject GetProject()
```

**Returns:** [CRMScript.NetServer.NSProject](CRMScript.NetServer.NSProject) - An appointment may also be connected to a project, so you see the appointment both on the company card, and on the project card. This does not mean however that a project is required.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSProject project = thing.GetProject();
```

## GetPublishEventDate()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Publish event date on NSAppointmentEntity.

## GetPublishFrom()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Publish from date on NSAppointmentEntity.

## GetPublishTo()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Publish to date on NSAppointmentEntity. After this date the event is no longer visible.

## GetRecurrence()

```crmscript theme={null}
NSRecurrenceInfo GetRecurrence()
```

**Returns:** [CRMScript.NetServer.NSRecurrenceInfo](CRMScript.NetServer.NSRecurrenceInfo) - The appointment recurrence.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSRecurrenceInfo recurrence = thing.GetRecurrence();
```

## GetRejectCounter()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - How many invitees have rejected this appointment?

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer rejectCounter = thing.GetRejectCounter();
```

## GetRejectReason()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Why was this booking or assignment rejected, the RejectReason list is a source of suggestions but you can write anything here.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String rejectReason = thing.GetRejectReason();
```

## GetSale()

```crmscript theme={null}
NSSale GetSale()
```

**Returns:** [CRMScript.NetServer.NSSale](CRMScript.NetServer.NSSale) - An appointment may also be connected to a sale, so you see the appointment on the company card, on the project card and on the sale card. This does not mean however that a sale is required.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSSale sale = thing.GetSale();
```

## GetStartDate()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - date + start time planned.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
DateTime startDate = thing.GetStartDate();
```

## GetSuggestedAppointmentId()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - Suggested guide item that this appointment is an instance of

<Note>
  NOT VALID for document-type appointments, they have their own link
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer suggestedAppointmentId = thing.GetSuggestedAppointmentId();
```

## GetTitle()

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

**Returns:** [CRMScript.Global.String](CRMScript.Global.String) - Title for the appointment.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String title = thing.GetTitle();
```

## GetTask()

```crmscript theme={null}
NSTaskListItem GetTask()
```

**Returns:** [CRMScript.NetServer.NSTaskListItem](CRMScript.NetServer.NSTaskListItem) - Task comprises the different types of activities, such as Phone call or Meeting.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSTaskListItem task = thing.GetTask();
```

## GetType()

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

**Returns:** [CRMScript.Global.Integer](CRMScript.Global.Integer) - The different types of appointment, if the appointment is supposed to be shown in the diary or checklist, or if it's a document.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer type = thing.GetType();
```

## GetUpdatedBy()

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

**Returns:** [CRMScript.NetServer.NSAssociate](CRMScript.NetServer.NSAssociate) - The person that last updated the appointment.

**Example:**

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

## GetUpdatedDate()

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

**Returns:** [CRMScript.Global.DateTime](CRMScript.Global.DateTime) - Updated date.

**Example:**

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

## GetUserDefinedFields()

Gets the user-defined fields on the NSAppointmentEntity as a map.

```crmscript theme={null}
Map GetUserDefinedFields()
```

**Returns:** [CRMScript.Native.Map](CRMScript.Native.Map) - Map containing user defined field values by field prog.id.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Map fields = thing.GetUserDefinedFields();
String oldValue = fields.get("SuperOffice:1");
fields.insert("SuperOffice:1", "NewValue");
for (fields.first(); !fields.eof(); fields.next())
  printLine(fields.getKey() + ":  " + fields.getVal());
```

## GetVisibleFor()

Returns the usergroups and/or users the NSAppointmentEntity item is visible for.

```crmscript theme={null}
NSVisibleFor[] GetVisibleFor()
```

**Returns:** [CRMScript.NetServer.NSVisibleFor](CRMScript.NetServer.NSVisibleFor)\[] - Visible for array.

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSVisibleFor[] visibleFor = thing.GetVisibleFor();
```

## SetActiveDate(DateTime)

```crmscript theme={null}
Void SetActiveDate(DateTime activeDate)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
DateTime activeDate;
thing.SetActiveDate(activeDate);
```

## SetActiveLinks(Integer)

```crmscript theme={null}
Void SetActiveLinks(Integer activeLinks)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer activeLinks;
thing.SetActiveLinks(activeLinks);
```

## SetAlarmLeadTime(TimeSpan)

```crmscript theme={null}
Void SetAlarmLeadTime(TimeSpan alarmLeadTime)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
TimeSpan alarmLeadTime;
thing.SetAlarmLeadTime(alarmLeadTime);
```

## SetAlldayEvent(Bool)

```crmscript theme={null}
Void SetAlldayEvent(Bool isAllDayEvent)
```

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

## SetAppointmentId(Integer)

```crmscript theme={null}
Void SetAppointmentId(Integer appointmentId)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer appointmentId;
thing.SetAppointmentId(appointmentId);
```

## SetAssignedBy(NSAssociate)

```crmscript theme={null}
Void SetAssignedBy(NSAssociate assignedBy)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSAssociate assignedBy;
thing.SetAssignedBy(assignedBy);
```

## SetAssignmentStatus(Integer)

```crmscript theme={null}
Void SetAssignmentStatus(Integer assignmentStatus)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer assignmentStatus;
thing.SetAssignmentStatus(assignmentStatus);
```

## SetAgenda(String)

```crmscript theme={null}
Void SetAgenda(String agenda)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String agenda;
thing.SetAgenda(agenda);
```

## SetAssociate(NSAssociate)

```crmscript theme={null}
Void SetAssociate(NSAssociate associate)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSAssociate associate;
thing.SetAssociate(associate);
```

## SetBookingType(Integer)

```crmscript theme={null}
Void SetBookingType(Integer bookingType)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer bookingType;
thing.SetBookingType(bookingType);
```

## SetCautionWarning(Integer)

```crmscript theme={null}
Void SetCautionWarning(Integer cautionWarning)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer cautionWarning;
thing.SetCautionWarning(cautionWarning);
```

## SetCentralserviceVideomeetId(String)

```crmscript theme={null}
Void SetCentralserviceVideomeetId(String centralserviceVideomeetId)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String centralserviceVideomeetId;
thing.SetCentralserviceVideomeetId(centralserviceVideomeetId);
```

## SetColorIndex(Integer)

```crmscript theme={null}
Void SetColorIndex(Integer colorIndex)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer colorIndex;
thing.SetColorIndex(colorIndex);
```

## SetCompleted(Integer)

```crmscript theme={null}
Void SetCompleted(Integer completed)
```

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

<Note>
  This property is the part of the Status property that is the completed state. Could be three state if the three state user preference is set.
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer completed;
thing.SetCompleted(completed);
```

## SetContact(NSContact)

```crmscript theme={null}
Void SetContact(NSContact contact)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSContact contact;
thing.SetContact(contact);
```

## SetCreatedBy(NSAssociate)

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

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

<Note>
  The property is read-only.
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity 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}
NSAppointmentEntity thing;
DateTime createdDate;
thing.SetCreatedDate(createdDate);
```

## SetCustomFields(Map)

Sets the user-defined and extra fields on an NSAppointmentEntity with a map.

```crmscript theme={null}
Void SetCustomFields(Map udefs)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Map udefs;
udefs["SuperOffice:1"] = "[I:123]";
udefs["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
udefs["custom.progid"] = "foobar";
udefs["x_foo"] = "foobar";
udefs["x_bar"] = "456"; // List item id
thing.SetCustomFields(udefs);
```

## SetDescription(String)

```crmscript theme={null}
Void SetDescription(String description)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String description;
thing.SetDescription(description);
```

## SetEndDate(DateTime)

```crmscript theme={null}
Void SetEndDate(DateTime endDate)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
DateTime endDate;
thing.SetEndDate(endDate);
```

## SetExtraFields(Map)

Sets the extra field values on NSAppointmentEntity with a map.

```crmscript theme={null}
Void SetExtraFields(Map extras)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Map extras;
extras["SuperOffice:1"] = "[I:123]";
extras["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
extras["custom.progid"] = "foobar";
thing.SetExtraFields(extras);
```

## SetFreeBusy(Bool)

```crmscript theme={null}
Void SetFreeBusy(Bool isFreeBusy)
```

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

## SetHasAlarm(Bool)

```crmscript theme={null}
Void SetHasAlarm(Bool hasAlarm)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool hasAlarm;
thing.SetHasAlarm(hasAlarm);
```

## SetHasConflict(Bool)

```crmscript theme={null}
Void SetHasConflict(Bool hasConflict)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool hasConflict;
thing.SetHasConflict(hasConflict);
```

## SetInternalNotes(String)

```crmscript theme={null}
Void SetInternalNotes(String internalNotes)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String notes;
thing.SetInternalNotes(notes);
```

## SetInvitationStatus(Integer)

```crmscript theme={null}
Void SetInvitationStatus(Integer invitationStatus)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer invitationStatus;
thing.SetInvitationStatus(invitationStatus);
```

## SetInvitedPerson(NSPerson)

```crmscript theme={null}
Void SetInvitedPerson(NSPerson invitedPerson)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSPerson invitedPerson;
thing.SetInvitedPerson(invitedPerson);
```

## SetIsAlldayEvent(Bool)

```crmscript theme={null}
Void SetIsAlldayEvent(Bool isAlldayEvent)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool isAlldayEvent;
thing.SetIsAlldayEvent(isAlldayEvent);
```

## SetIsFree(Bool)

```crmscript theme={null}
Void SetIsFree(Bool isFree)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool isFree;
thing.SetIsFree(isFree);
```

## SetIsMileStone(Bool)

```crmscript theme={null}
Void SetIsMileStone(Bool isMileStone)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Bool isMileStone;
thing.SetIsMileStone(isMileStone);
```

## SetIsPublished(Bool)

Sets the isPublished property of the appointment.

```crmscript theme={null}
Void SetIsPublished(Bool isPublished)
```

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

## SetJoinVideomeetUrl(String)

```crmscript theme={null}
Void SetJoinVideomeetUrl(String joinVideomeetUrl)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String joinVideomeetUrl;
thing.SetJoinVideomeetUrl(joinVideomeetUrl);
```

## SetLagTime(TimeSpan)

```crmscript theme={null}
Void SetLagTime(TimeSpan lagTime)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
TimeSpan lagTime;
thing.SetLagTime(lagTime);
```

## SetLeadTime(TimeSpan)

```crmscript theme={null}
Void SetLeadTime(TimeSpan leadTime)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
TimeSpan leadTime;
thing.SetLeadTime(leadTime);
```

## SetLinks(NSLink\[])

```crmscript theme={null}
Void SetLinks(NSLink[] links)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSLink[] links;
thing.SetLinks(links);
```

## SetLocation(String)

```crmscript theme={null}
Void SetLocation(String location)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String location;
thing.SetLocation(location);
```

## SetMotherAssociate(NSAssociate)

```crmscript theme={null}
Void SetMotherAssociate(NSAssociate motherAssociate)
```

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

<Note>
  The mother appointment is the one identified by the mother\_id. If the mother\_id is 0 or the same as this appointment\_id, then the master associate will be the same as the 'ordinary' associate.
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSAssociate motherAssociate;
thing.SetMotherAssociate(motherAssociate);
```

## SetMotherId(Integer)

```crmscript theme={null}
Void SetMotherId(Integer motherId)
```

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

<Note>
  If 0 and assoc\_id != reg\_id then this is an assigned appointment, indicated vt type = kBooking
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer motherId;
thing.SetMotherId(motherId);
```

## SetParticipants(NSParticipantInfo\[])

```crmscript theme={null}
Void SetParticipants(NSParticipantInfo[] participants)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSParticipantInfo[] participants;
thing.SetParticipants(participants);
```

## SetPerson(NSPerson)

```crmscript theme={null}
Void SetPerson(NSPerson person)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSPerson person;
thing.SetPerson(person);
```

## SetPreferredTZLocation(Integer)

```crmscript theme={null}
Void SetPreferredTZLocation(Integer preferredTZLocation)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer preferredTZLocation;
thing.SetPreferredTZLocation(preferredTZLocation);
```

## SetPriority(NSPriority)

It's possible to give appointments different priorities. All the different priority types are saved in the priority table, and edited from the Admin Client. An appointment does not require a priority.

```crmscript theme={null}
Void SetPriority(NSPriority priority)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSPriority priority;
thing.SetPriority(priority);
```

## SetPrivate(Integer)

The confidentiality of appointments is shown as different types of private on the appointment.

```crmscript theme={null}
Void SetPrivate(Integer private)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer private;
thing.SetPrivate(private);
```

## SetProject(NSProject)

```crmscript theme={null}
Void SetProject(NSProject project)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSProject project;
thing.SetProject(project);
```

## SetPublishEventDate(DateTime)

```crmscript theme={null}
Void SetPublishEventDate(DateTime publishDate)
```

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

## SetPublishFrom(DateTime)

Sets the publish from date on an NSAppointmentEntity.

```crmscript theme={null}
Void SetPublishFrom(DateTime publishFrom)
```

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

## SetPublishTo(DateTime)

Sets the publish to date on NSAppointmentEntity.

```crmscript theme={null}
Void SetPublishTo(DateTime publishTo)
```

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

## SetRecurrence(NSRecurrenceInfo)

```crmscript theme={null}
Void SetRecurrence(NSRecurrenceInfo recurrence)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSRecurrenceInfo recurrence;
thing.SetRecurrence(recurrence);
```

## SetRejectCounter(Integer)

```crmscript theme={null}
Void SetRejectCounter(Integer rejectCounter)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer rejectCounter;
thing.SetRejectCounter(rejectCounter);
```

## SetRejectReason(String)

```crmscript theme={null}
Void SetRejectReason(String rejectReason)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String rejectReason;
thing.SetRejectReason(rejectReason);
```

## SetSale(NSSale)

```crmscript theme={null}
Void SetSale(NSSale sale)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSSale sale;
thing.SetSale(sale);
```

## SetStartDate(DateTime)

```crmscript theme={null}
Void SetStartDate(DateTime startDate)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
DateTime startDate;
thing.SetStartDate(startDate);
```

## SetSuggestedAppointmentId(Integer)

```crmscript theme={null}
Void SetSuggestedAppointmentId(Integer suggestedAppointmentId)
```

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

<Note>
  NOT VALID for document-type appointments, they have their own link.
</Note>

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer suggestedAppointmentId;
thing.SetSuggestedAppointmentId(suggestedAppointmentId);
```

## SetTitle(String)

```crmscript theme={null}
Void SetTitle(String agenda)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
String title;
thing.SetTitle(title);
```

## SetTask(NSTaskListItem)

```crmscript theme={null}
Void SetTask(NSTaskListItem task)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSTaskListItem task;
thing.SetTask(task);
```

## SetType(Integer)

```crmscript theme={null}
Void SetType(Integer type)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Integer type;
thing.SetType(type);
```

## SetUpdatedBy(NSAssociate)

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

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity 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}
NSAppointmentEntity thing;
DateTime updatedDate;
thing.SetUpdatedDate(updatedDate);
```

## SetUserDefinedFields(Map)

Sets the user-defined fields on the NSAppointmentEntity as a map.

```crmscript theme={null}
Void SetUserDefinedFields(Map udefs)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
Map udefs;
udefs["SuperOffice:1"] = "[I:123]";
udefs["SuperOffice:1"] = "123"; // this will also work, but beware of decimal point variations in different languages
udefs["custom.progid"] = "foobar";
thing.SetUserDefinedFields(udefs);
```

## SetVisibleFor(NSVisibleFor\[])

Sets the usergroups and/or users the NSAppointmentEntity item is visible for.

```crmscript theme={null}
Void SetVisibleFor(NSVisibleFor[] visibleFor)
```

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

**Example:**

```crmscript theme={null}
NSAppointmentEntity thing;
NSVisibleFor[] visibleFor = thing.GetVisibleFor();
visibleFor[0].SetVisiblity(1);  // usergroup
visibleFor[0].SetVisibleId(123); // usergroup id
thing.SetVisibleFor(visibleFor);
```


## Related topics

- [NSAppointmentAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSAppointmentAgent.md)
