Skip to main content
Contact (company) data services.

Constructors

NSContactAgent()

Initializes a new instance of the NSContactAgent class.

Methods

AddPerson(Integer,NSPersonEntity)

Adds a person to the given contact
Returns: CRMScript.NetServer.NSPersonEntity - Updated person object. Example:

ChangeCountry(NSContactEntity,Integer)

Changes country regenerates the default values and localized information such as phone number and address format
Returns: CRMScript.NetServer.NSContactEntity

Copy(Integer,String,String,Bool)

Copies a contact. Activities and related data will be ignored
Returns: CRMScript.Global.Integer - ID of copied contact. Example:

CreateDefaultContactEntity()

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

CreateNewEntry(NSDuplicateEntry)

Creates a new contact based on external duplicate
Returns: CRMScript.Global.Integer - The database identity of the newly created entry. Example:

DeleteContactEntity(Integer)

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

DeleteExpired()

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

GetAddress(Integer)

Gets a contact’s localized addressGets the contact’s localized address
Returns: CRMScript.NetServer.LocalizedField[][] Example:

GetAddressByCountry(Integer,Integer)

Gets a contact’s localized addressGets the contact’s localized address
Returns: CRMScript.NetServer.LocalizedField[][] Example:

GetContact(Integer)

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

GetContactEntity(Integer)

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

GetContactList(Integer[])

Gets an array of Contact objects.
Returns: CRMScript.NetServer.NSContact[] - Array of NSContact. Example:

GetContactSummary(Integer,Integer)

Gets summary of contact and its recent activity.
Returns: CRMScript.NetServer.NSContactSummary - Summary of contact, with recent requests, sales, follow-ups, chats. Example:

GetContactWithPersons(Integer)

Returns the contact with all the contact persons belonging to the contact
Returns: CRMScript.NetServer.NSContactEntity - ContactEntity with all data and persons. Example:

GetDuplicateRules()

Retrieves all available duplicate rules for contact
Returns: CRMScript.NetServer.NSDuplicateRule[] - All available duplicate rules. Example:

GetDuplicates(String)

Gets duplicates (exact or similar in the database) based on the name
Returns: CRMScript.NetServer.NSDuplicateEntry[] - Any records matching the specified name. Example:

GetMyActiveContacts(DateTime,Integer[],Integer)

Returns the contacts where there has been activity since activityStartTime.
Returns: CRMScript.NetServer.NSContactActivity[] - Array of contacts where there have been activity in the period.
If activityStartTime is larger than the current date, all contacts with activity since the last log-out are returned. The result set can be filtered by category and action type.
Example:

GetMyBizCard()

Returns all data needed to display the logged on person’s business card (company, person, and company interest data).
Returns: CRMScript.NetServer.NSContactEntity - The contact object with persons and interests. Example:

GetMyContact()

Gets the contact belonging to the currently logged-on user.
Returns: CRMScript.NetServer.NSContactEntity Example:

GetMyContacts()

Gets the contacts where the user currently logged in is set as contact owner.
Returns: CRMScript.NetServer.NSContact[] - The contact. Example:

GetMyRecentContacts(Integer)

Returns a set of initial contacts.
Returns: CRMScript.NetServer.NSContact[] - Array of contacts.
This could be the contacts in a favorites selection, the history list, the diary, or from all sources. If retrieved from the diary it will get appointments for the current and the next day.
Example:

GetNameDepartmentDuplicates(String,String)

Gets duplicates based on the contact name and department
Returns: CRMScript.NetServer.NSDuplicateEntry[] - Any records matching the specified name and department. Example:

GetPersons(Integer)

Returns an array of all the contact persons for the company card.
Returns: CRMScript.NetServer.NSPerson[] - Array of Persons. Example:

GetQuoteVersionAddresses(Integer)

Gets the associated billing and invoice quote version addresses.
Returns: CRMScript.NetServer.NSAddress[] - The quote version addresses. Invoice and billing address, in that order.
These addresses might be address on the contact, or a custom address.
Example:

IsNumberValid(Integer,String)

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

Merge(Integer,Integer,Bool,Bool)

Merges two contacts. The destination contact will remain.
Returns: CRMScript.Global.Void

SaveContactEntity(NSContactEntity)

Updates the existing NSContactEntity or creates a new NSContactEntity if the ID parameter is 0.
Returns: CRMScript.NetServer.NSContactEntity - The new or updated NSContactEntity. Example:

SaveQuoteVersionAddress(Integer,NSAddress,Integer,Integer)

Saves a custom quote version address.
Returns: CRMScript.NetServer.NSAddress - The saved addresses. Example:

SetDuplicateRulesStatus(NSDuplicateRule[])

Sets which duplicate rules should be active or not
Returns: CRMScript.Global.Void

Undelete(Integer)

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

ValidateContactEntity(NSContactEntity)

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