Show / Hide Table of Contents

Class NSDocumentEntity

Syntax

Constructors

NSDocumentEntity()

Initializes a new instance of the NSDocumentEntity class.

Declaration
NSDocumentEntity

Methods

GetActiveLinks()

Declaration
Integer GetActiveLinks()
Returns
Type Description
Integer

Number of active links to sale, document, appointment.

Examples
NSDocumentEntity thing;
Integer activeLinks = thing.GetActiveLinks();

GetAssociate()

Declaration
NSAssociate GetAssociate()
Returns
Type Description
NSAssociate

The owner of the document* the associate whose checklist the document is in.

Examples
NSDocumentEntity thing;
NSAssociate associate = thing.GetAssociate();

GetAttention()

Declaration
String GetAttention()
Returns
Type Description
String

Attention/salutation.

Examples
NSDocumentEntity thing;
String attention = thing.GetAttention();

GetCompleted()

Declaration
Integer GetCompleted()
Returns
Type Description
Integer

Document Completed state. This is the part of the Status property.

Examples
NSDocumentEntity thing;
Integer completed = thing.GetCompleted();

GetContact()

Declaration
NSContact GetContact()
Returns
Type Description
NSContact

The contact associated with the document. It may also be null if no contact is associated with the document.

Examples
NSDocumentEntity thing;
NSContact contact = thing.GetContact();

GetCreatedBy()

Declaration
NSAssociate GetCreatedBy()
Returns
Type Description
NSAssociate

The person that first created the document. The property is read-only.

Examples
NSDocumentEntity thing;
NSAssociate createdBy = thing.GetCreatedBy();

GetCreatedDate()

Declaration
DateTime GetCreatedDate()
Returns
Type Description
DateTime

Registered when.

Examples
NSDocumentEntity thing;
DateTime createdDate = thing.GetCreatedDate();

GetCustomFields()

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

Declaration
Map GetCustomFields()
Returns
Type Description
Map
Examples
NSDocumentEntity 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());

GetDate()

Declaration
DateTime GetDate()
Returns
Type Description
DateTime

date + start time planned.

Examples
NSDocumentEntity thing;
DateTime date = thing.GetDate();

GetDescription()

Declaration
String GetDescription()
Returns
Type Description
String

The actual text, max 2047 significant characters even though it is stored as a larger data type on some databases.

Examples
NSDocumentEntity thing;
String description = thing.GetDescription();

GetDocumentId()

Declaration
Integer GetDocumentId()
Returns
Type Description
Integer

Primary key.

Examples
NSDocumentEntity thing;
Integer documentId = thing.GetDocumentId();

GetDocumentTemplate()

Declaration
NSDocumentTemplate GetDocumentTemplate()
Returns
Type Description
NSDocumentTemplate

The template type of the document.

Examples
NSDocumentEntity thing;
NSDocumentTemplate documentTemplate = thing.GetDocumentTemplate();

GetExternalRef()

Declaration
String GetExternalRef()
Returns
Type Description
String

External reference for document plugin to resolve document identity (Notes ID, e-mail message ID, whatever).

Examples
NSDocumentEntity thing;
String externalRef = thing.GetExternalRef();

GetExtraFields()

Gets the extra fields on NSDocumentEntity as a map.

Declaration
Map GetExtraFields()
Returns
Type Description
Map
Examples
NSDocumentEntity 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());

GetHeader()

Declaration
String GetHeader()
Returns
Type Description
String

Visible document name.

Examples
NSDocumentEntity thing;
String header = thing.GetHeader();

GetIsPublished()

Declaration
Bool GetIsPublished()
Returns
Type Description
Bool

Should this NSDocumentEntity be published and visible to strangers?

GetLinks()

Declaration
NSLink[] GetLinks()
Returns
Type Description
NSLink[]

List of all elements linked to the document.

Examples
NSDocumentEntity thing;
NSLink[] links = thing.GetLinks();

GetLockSemantics()

Declaration
Integer GetLockSemantics()
Returns
Type Description
Integer

See DocumentLockSemantics

Examples
NSDocumentEntity thing;
Integer lockSemantics = thing.GetLockSemantics();

GetName()

Declaration
String GetName()
Returns
Type Description
String

File name.

Examples
NSDocumentEntity thing;
String name = thing.GetName();

GetOurRef()

Declaration
String GetOurRef()
Returns
Type Description
String

Our reference, searchable field from free-text search.

Examples
NSDocumentEntity thing;
String ourRef = thing.GetOurRef();

GetPerson()

Declaration
NSPerson GetPerson()
Returns
Type Description
NSPerson

A document 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.

Examples
NSDocumentEntity thing;
NSPerson person = thing.GetPerson();

GetProject()

Declaration
NSProject GetProject()
Returns
Type Description
NSProject

A document may also be connected to a project, so you see the document both on the company card, and on the project card. This does not mean however that a project is required.

Examples
NSDocumentEntity thing;
NSProject project = thing.GetProject();

GetPublishEventDate()

Declaration
DateTime GetPublishEventDate()
Returns
Type Description
DateTime

Publish event date on NSDocumentEntity.

GetPublishFrom()

Declaration
DateTime GetPublishFrom()
Returns
Type Description
DateTime

Publish from date on NSDocumentEntity.

GetPublishTo()

Declaration
DateTime GetPublishTo()
Returns
Type Description
DateTime

Publish to date on NSDocumentEntity. After this date the event is no longer visible.

GetSale()

Declaration
NSSale GetSale()
Returns
Type Description
NSSale

A document may also be connected to a sale, so you see the document on the company card, on the project card and on the sale card. This does not mean however that a sale is required. May be null.

Examples
NSDocumentEntity thing;
NSSale sale = thing.GetSale();

GetSnum()

Declaration
Integer GetSnum()
Returns
Type Description
Integer

The sequence number allocated from refcount on used template when creating the document.

Examples
NSDocumentEntity thing;
Integer snum = thing.GetSnum();

GetSuggestedDocumentId()

Declaration
Integer GetSuggestedDocumentId()
Returns
Type Description
Integer

Suggested guide item that this document is an instance of.

Remarks

NOT valid for appointments, they have their own link

Examples
NSDocumentEntity thing;
Integer suggestedDocumentId = thing.GetSuggestedDocumentId();

GetType()

Declaration
Integer GetType()
Returns
Type Description
Integer

Is this a normal document or a mail-merge or report?

Examples
NSDocumentEntity thing;
Integer type = thing.GetType();

GetUpdatedBy()

Declaration
NSAssociate GetUpdatedBy()
Returns
Type Description
NSAssociate

The person that last updated the appointment.

Examples
NSDocumentEntity thing;
NSAssociate updatedBy = thing.GetUpdatedBy();

GetUpdatedDate()

Declaration
DateTime GetUpdatedDate()
Returns
Type Description
DateTime

Last updated when.

Examples
NSDocumentEntity thing;
DateTime updatedDate = thing.GetUpdatedDate();

GetUserDefinedFields()

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

Declaration
Map GetUserDefinedFields()
Returns
Type Description
Map
Examples
NSDocumentEntity 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()

Declaration
NSVisibleFor[] GetVisibleFor()
Returns
Type Description
NSVisibleFor[]

Return the user groups and/or users the NSDocumentEntity item is visible for.

Examples
NSDocumentEntity thing;
NSVisibleFor[] visibleFor = thing.GetVisibleFor();

GetYourRef()

Declaration
String GetYourRef()
Returns
Type Description
String

Your reference.

Examples
NSDocumentEntity thing;
String yourRef = thing.GetYourRef();

SetActiveLinks(Integer)

Declaration
Void SetActiveLinks(Integer activeLinks)
Parameters
Type Name Description
Integer activeLinks

Number of active links to sale, document, appointment.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
Integer activeLinks;
thing.SetActiveLinks(activeLinks);

SetAssociate(NSAssociate)

Declaration
Void SetAssociate(NSAssociate associate)
Parameters
Type Name Description
NSAssociate associate

The owner of the document* the associate whose checklist the document is in.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
NSAssociate associate;
thing.SetAssociate(associate);

SetAttention(String)

Declaration
Void SetAttention(String attention)
Parameters
Type Name Description
String attention

Attention/salutation.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
String attention;
thing.SetAttention(attention);

SetCompleted(Integer)

Declaration
Void SetCompleted(Integer completed)
Parameters
Type Name Description
Integer completed

Document Completed state. This is the part of the Status property.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
Integer completed;
thing.SetCompleted(completed);

SetContact(NSContact)

Declaration
Void SetContact(NSContact contact)
Parameters
Type Name Description
contact

The contact associated with the document. It may also be null if no contact is associated with the document.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
NSContact contact;
thing.SetContact(contact);

SetCreatedBy(NSAssociate)

Declaration
Void SetCreatedBy(NSAssociate createdBy)
Parameters
Type Name Description
NSAssociate createdBy

The person that first created the document. The property is read-only.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
NSAssociate createdBy;
thing.SetCreatedBy(createdBy);

SetCreatedDate(DateTime)

Declaration
Void SetCreatedDate(DateTime createdDate)
Parameters
Type Name Description
DateTime createdDate

Registered when.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
DateTime createdDate;
thing.SetCreatedDate(createdDate);

SetCustomFields(Map)

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

Declaration
Void SetCustomFields(Map udefs)
Parameters
Type Name Description
Map udefs

user-defined and extra fields.

Returns
Type Description
Void
Examples
NSDocumentEntity 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);

SetDate(DateTime)

Declaration
Void SetDate(DateTime date)
Parameters
Type Name Description
DateTime date

date + start time planned.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
DateTime date;
thing.SetDate(date);

SetDescription(String)

Declaration
Void SetDescription(String description)
Parameters
Type Name Description
String description

The actual text, max 2047 significant characters even though it is stored as a larger data type on some databases.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
String description;
thing.SetDescription(description);

SetDocumentId(Integer)

Declaration
Void SetDocumentId(Integer documentId)
Parameters
Type Name Description
Integer documentId

Primary key.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
Integer documentId;
thing.SetDocumentId(documentId);

SetDocumentTemplate(NSDocumentTemplate)

Declaration
Void SetDocumentTemplate(NSDocumentTemplate documentTemplate)
Parameters
Type Name Description
NSDocumentTemplate documentTemplate

The template type of the document.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
NSDocumentTemplate documentTemplate;
thing.SetDocumentTemplate(documentTemplate);

SetExternalRef(String)

Declaration
Void SetExternalRef(String externalRef)
Parameters
Type Name Description
String externalRef

External reference for document plugin to resolve document identity (Notes ID, email message ID, whatever).

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
String externalRef;
thing.SetExternalRef(externalRef);

SetExtraFields(Map)

Sets the extra field values on NSDocumentEntity with a map.

Declaration
Void SetExtraFields(Map extras)
Parameters
Type Name Description
Map extras

extra-field values.

Returns
Type Description
Void
Examples
NSDocumentEntity 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);

SetHeader(String)

Declaration
Void SetHeader(String header)
Parameters
Type Name Description
String header

Visible document name.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
String header;
thing.SetHeader(header);

SetIsPublished(Bool)

Sets the IsPublished property

Declaration
Void SetIsPublished(Bool isPublished)
Parameters
Type Name Description
Bool isPublished

Should this NSDocumentEntity be published and visible to strangers?

Returns
Type Description
Void

SetLinks(NSLink[])

Declaration
Void SetLinks(NSLink[] links)
Parameters
Type Name Description
NSLink[] links

List of all elements linked to the document.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
NSLink[] links;
thing.SetLinks(links);

SetLockSemantics(Integer)

Declaration
Void SetLockSemantics(Integer lockSemantics)
Parameters
Type Name Description
Integer lockSemantics

See DocumentLockSemantics.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
Integer lockSemantics;
thing.SetLockSemantics(lockSemantics);

SetName(String)

Declaration
Void SetName(String name)
Parameters
Type Name Description
String name

File name.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
String name;
thing.SetName(name);

SetOurRef(String)

Declaration
Void SetOurRef(String ourRef)
Parameters
Type Name Description
String ourRef

Our reference, searchable field from free-text search.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
String ourRef;
thing.SetOurRef(ourRef);

SetPerson(NSPerson)

Declaration
Void SetPerson(NSPerson person)
Parameters
Type Name Description
NSPerson person
Returns
Type Description
Void
Remarks

A document 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.

Examples
NSDocumentEntity thing;
NSPerson person;
thing.SetPerson(person);

SetProject(NSProject)

Declaration
Void SetProject(NSProject project)
Parameters
Type Name Description
NSProject project
Returns
Type Description
Void
Remarks

A document may also be connected to a project, so you see the document both on the company card, and on the project card. This does not mean however that a project is required.

Examples
NSDocumentEntity thing;
NSProject project;
thing.SetProject(project);

SetPublishEventDate(DateTime)

Declaration
Void SetPublishEventDate(DateTime publishDate)
Parameters
Type Name Description
DateTime publishDate

Publish event date on NSDocumentEntity.

Returns
Type Description
Void

SetPublishFrom(DateTime)

Sets the publish from date on an NSDocumentEntity.

Declaration
Void SetPublishFrom(DateTime publishFrom)
Parameters
Type Name Description
DateTime publishFrom
Returns
Type Description
Void

SetPublishTo(DateTime)

Sets the publish to date on NSDocumentEntity. After this date the event is no longer visible.

Declaration
Void SetPublishTo(DateTime publishTo)
Parameters
Type Name Description
DateTime publishTo
Returns
Type Description
Void

SetSale(NSSale)

Declaration
Void SetSale(NSSale sale)
Parameters
Type Name Description
NSSale sale
Returns
Type Description
Void
Remarks

A document may also be connected to a sale, so you see the document on the company card, on the project card and on the sale card. This does not mean however that a sale is required. May be null.

Examples
NSDocumentEntity thing;
NSSale sale;
thing.SetSale(sale);

SetSnum(Integer)

Declaration
Void SetSnum(Integer snum)
Parameters
Type Name Description
Integer snum

The sequence number allocated from refcount on used template when creating the document.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
Integer snum;
thing.SetSnum(snum);

SetSuggestedDocumentId(Integer)

Declaration
Void SetSuggestedDocumentId(Integer suggestedDocumentId)
Parameters
Type Name Description
Integer suggestedDocumentId

Suggested guide item that this document is an instance of.

Returns
Type Description
Void
Remarks

NOT valid for appointments, they have their own link

Examples
NSDocumentEntity thing;
Integer suggestedDocumentId;
thing.SetSuggestedDocumentId(suggestedDocumentId);

SetType(Integer)

Declaration
Void SetType(Integer type)
Parameters
Type Name Description
Integer type

Is this a normal document or a mail-merge or report? See AppointmentType.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
Integer type;
thing.SetType(type);

SetUpdatedBy(NSAssociate)

Declaration
Void SetUpdatedBy(NSAssociate updatedBy)
Parameters
Type Name Description
NSAssociate associate

The person that last updated the appointment.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
NSAssociate updatedBy;
thing.SetUpdatedBy(updatedBy);

SetUpdatedDate(DateTime)

Declaration
Void SetUpdatedDate(DateTime updatedDate)
Parameters
Type Name Description
DateTime updatedDate

Last updated when.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
DateTime updatedDate;
thing.SetUpdatedDate(updatedDate);

SetUserDefinedFields(Map)

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

Declaration
Void SetUserDefinedFields(Map udefs)
Parameters
Type Name Description
Map udefs

user-defined fields.

Returns
Type Description
Void
Examples
NSDocumentEntity 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 user groups and/or users the NSDocumentEntity item is visible for.

Declaration
Void SetVisibleFor(NSVisibleFor[] visibleFor)
Parameters
Type Name Description
NSVisibleFor[] visibleFor
Returns
Type Description
Void
Examples
NSDocumentEntity thing;
NSVisibleFor[] visibleFor = thing.GetVisibleFor();
visibleFor[0].SetVisiblity(1);  // usergroup
visibleFor[0].SetVisibleId(123); // usergroup id
thing.SetVisibleFor(visibleFor);

SetYourRef(String)

Declaration
Void SetYourRef(String yourRef)
Parameters
Type Name Description
String yourRef

Your reference.

Returns
Type Description
Void
Examples
NSDocumentEntity thing;
String yourRef;
thing.SetYourRef(yourRef);
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top