Skip to main content
Person data services.

Constructors

NSPersonAgent()

Person data services.

Methods

AddBounce(String)

Adds a bounce count on the email address if it exists
Returns: CRMScript.Global.Void

AddBounceWithCount(String,Integer)

Adds a number of bounce counts on the email address if it exists
Returns: CRMScript.Global.Void

AddEmailAddressToPerson(Integer,String,Bool)

Sets the primary email address on person, possibly re-ranking email addresses accordingly.
Returns: CRMScript.Global.Void

ChangeCountry(NSPersonEntity,Integer)

Changes country and regenerates the default values and localized information such as phone number and address format for this entity.
Returns: CRMScript.NetServer.NSPersonEntity Example:

ChangePersonRank(Integer,Bool)

Moves one person up or down in the ranking in the Person Archive, if possible. Corresponds to the move up/move down functions in the person archive in the contact panel.
Returns: CRMScript.Global.Integer
The person record that has rank = 1 is the primary contact for a company, and is the one used in situations where no person has been explicitly chosen (such as in selections).This method always affects two records.
Example:

CheckTemporaryKey(String)

Checks a temporary key for validity, and in case it is valid, return its domain, targetId and personId
Returns: CRMScript.NetServer.NSTemporaryKeyInfo Example:

CreateDefaultByContactId(Integer)

Creates an NSPersonEntity with default values based on the contactId.
Returns: CRMScript.NetServer.NSPersonEntity

CreateDefaultConsentPerson()

Sets default values into a new NSConsentPerson.
Returns: CRMScript.NetServer.NSConsentPerson - A new NSConsentPerson with default values.
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateDefaultFromCredential(Integer,String,String,String)

Creates an NSPersonEntity with default values based on the contactId and credentials.
Returns: CRMScript.NetServer.NSPersonEntity

CreateDefaultPersonEntity()

Sets default values into a new NSPersonEntity.
Returns: CRMScript.NetServer.NSPersonEntity - A new NSPersonEntity with default values.
NetServer calculates default values (for example, Country) on the entity, which is required when creating/storing a new instance
Example:

CreateTemporaryKey(Integer,Integer,Integer)

Creates a temporary key in the database from the given parameters and return the key string. Used for temporary keys for accessing customer centric functionality, such as UpdateSubscriptions.
Returns: CRMScript.Global.String Example:

DeleteConsentPerson(Integer)

Deletes the NSConsentPerson
Returns: CRMScript.Global.Void Example:

DeleteExpired()

Trigger deletion of persons that has been (soft) deleted and have timed out the expiry period (the SoftDeleteRetention preference).
Returns: CRMScript.Global.Void

DeletePersonEntity(Integer)

Deletes the NSPersonEntity
Returns: CRMScript.Global.Void Example:

DeleteTemporaryKeysOfDomain(Integer,Integer)

Deletes all temporary keys for a given domain and person
Returns: CRMScript.Global.Void

GetAddress(Integer)

Gets the person’s localized addressGets the person’s localized address.
Returns: CRMScript.NetServer.NSLocalizedField[][] - The address. Example:

GetAddressByCountry(Integer,Integer)

Gets the person’s localized addressGets the person’s localized address.
Returns: CRMScript.NetServer.NSLocalizedField[][] - The address. Example:

GetBestSoLanguageForTemplate(Integer,Integer)

Gets the best language for this person on this template
Returns: CRMScript.Global.String Example:

GetColleagues()

Gets the persons working in the same company as the logged-on user.
Returns: CRMScript.NetServer.NSPerson[] Example:

GetColleaguesByDepartment(Integer)

Gets the persons working in a specific department in the same company as the logged-on user
Returns: CRMScript.NetServer.NSPerson[]
Departments can be retrieved with the PhoneList.DepartmentList service.
Example:

GetColleaguesBySource(Integer,Integer)

Gets the persons working in the same company as the logged-on user.
Returns: CRMScript.NetServer.NSPerson[]
The list of persons could be retrieved from the history list, the diary view list, or from all sources.
Example:

GetConsentInfos(Integer)

Gets all consent information for a given person. May include withdrawn consents (check)
Returns: CRMScript.NetServer.NSConsentInfo[] Example:

GetConsentPerson(Integer)

Gets an NSConsentPerson object.
Returns: CRMScript.NetServer.NSConsentPerson Example:

GetMyOwner()

Gets the owner of the logged in person.
Returns: CRMScript.NetServer.NSPerson Example:

GetMyPerson()

Gets the person info belonging to the currently logged-on user.
Returns: CRMScript.NetServer.NSPersonEntity Example:

GetOwnerOnPersonId(Integer)

Gets the owner of the person by ID.
Returns: CRMScript.NetServer.NSPerson Example:

GetPerson(Integer)

Gets an NSPerson object.
Returns: CRMScript.NetServer.NSPerson Example:

GetPersonEntity(Integer)

Gets an NSPersonEntity object.
Returns: CRMScript.NetServer.NSPersonEntity Example:

GetPersonImage(Integer)

Returns the person image that is displayed in the CRM application.
Returns: CRMScript.NetServer.NSImage Example:

GetPersonList(Integer[])

Gets an array of NSPerson objects.
Returns: CRMScript.NetServer.NSPerson[] Example:

GetPersonsFromContact(Integer)

Returns all the persons belonging to a contact.
Returns: CRMScript.NetServer.NSPerson[] Example:

GetPersonsFromProject(Integer)

Returns all the persons belonging to a project.
Returns: CRMScript.NetServer.NSPerson[] Example:

GetPersonSummary(Integer,Integer)

Gets summary of person and recent activity.
Returns: CRMScript.NetServer.NSPersonSummary Example:

GetPhones(Integer)

Returns all phones that belong to a person, ordered by the phone type.
Returns: CRMScript.NetServer.NSEntityElement[] Example:

GetSalesRep(String,String,String,String,String)

Returns the sales representative for an external user.
Returns: CRMScript.NetServer.NSPersonEntity
If this method is accessed with anonymous authentication the external user is recognized by contact and name, or by email, or phone number.If the external user is recognized as an CRM5 user (internal or external) the input fields can be left blank.
Example:

HasConsent(Integer,String)

Checks if consent has been given by a specified person, for a specific purpose. Withdraw consents return FALSE.
Returns: CRMScript.Global.Bool Example:

IsNumberValid(Integer,String)

Checks if the number is unique or required.
Returns: CRMScript.Global.Bool
The setting is configured from admin under system options.
Example:

Merge(Integer,Integer,DateTime,Bool,Bool)

Merges two persons. The destination person will remain. You must specify the date after which activities will be moved along with the person.
Returns: CRMScript.Global.Void

Move(Integer,Integer,DateTime)

Moves a person to a specified contact. You must specify the date after which activities will be moved along with the person.
Returns: CRMScript.Global.Void

NormalizeRanks(Integer)

Normalize the ranks for all persons that belong to a contact. This means that the persons will be sorted according to their current rank values, and the ranks will be made monotonically increasing from 1.
Returns: CRMScript.Global.Bool Example:

RemoveConsent(Integer,String)

Turns off consent for a specified person and purpose.
Returns: CRMScript.Global.Void

ResolvePersonFromInfo(Integer,String,String[],String[])

Gets a person from the provided information. If the person does not exist, it will be created on demand.
Returns: CRMScript.NetServer.NSResolvedPerson Example:

SaveConsentPerson(NSConsentPerson)

Updates the existing NSConsentPerson or creates a new NSConsentPerson if the id parameter is 0
Returns: CRMScript.NetServer.NSConsentPerson Example:

SavePersonEntity(NSPersonEntity)

Creates or updates an NSPersonEntityUpdates the existing NSPersonEntity or creates a new NSPersonEntity if the ID parameter is 0.
Returns: CRMScript.NetServer.NSPersonEntity Example:

SendConsentConfirmationEmail(Integer,String,Integer,Integer,String)

Sends a confirmation email to the provided person, email address (id), using the document template
Returns: CRMScript.Global.Void

SetConsent(Integer,String,String,String,String)

Sets a specified type of consent on the person.
Returns: CRMScript.Global.Void

SetPersonImage(Integer)

Stores the person image that is displayed in the CRM application.
Returns: CRMScript.Global.Void

SetPersonRank(Integer,Integer)

Directly sets the rank field of a person record, adjusting all other person records under the same contact as needed.
Returns: CRMScript.Global.Bool
May affect multiple records, potentially all person records belonging to one contact.You must have write access for to affected records for this method to succeed.
Example:

TryAddPersonsToEmailFlow(Integer,Integer[])

Attempts to add multiple persons to an email flow, returning an array of boolean values indicating success for each person.
Returns: CRMScript.Global.Bool[] - An array of boolean values indicating whether each person was successfully added to the email flow. Example:

Undelete(Integer)

This entity supports Soft Delete. Call this method to Undelete a previously soft-deleted record
Returns: CRMScript.Global.Void Example:

ValidatePersonEntity(NSPersonEntity)

Checks that entity is ready for saving, return error messages by field.
Returns: CRMScript.Native.Map Example: