Class NSSelectionAgent
Selections, entities, members and tasks
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
Syntax
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSSelectionAgent()
Selections, entities, members and tasks
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
Declaration
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
Methods
Adds the collection of ContactPersonId as members to the static selection
Declaration
Void AddContactSelectionMembers(Integer selectionId, NSContactPersonId[] contactPersonIds)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
|
contactPersonIds |
|
Returns
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
Adds members to the selection from the search result.
Declaration
Integer AddContactSelectionMembersFromSearch(Integer selectionId, String storageKey)
Parameters
Returns
NSSelectionAgent agent;
Integer selectionId;
String storageKey;
Integer res = agent.AddContactSelectionMembersFromSearch(selectionId, storageKey);
Adds or removes interests on companies and persons in a selection.
Declaration
Void AddRemoveContactSelectionMemberInterests(Integer selectionId, Integer[] addCompanyInterests, Integer[] removeCompanyInterests, Integer[] addContactInterests, Integer[] removeContactInterests)
Parameters
Returns
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
AddSelectionMembers(Integer,Integer[])
Add selection members to a static selection of type others than contacts.
Declaration
Integer AddSelectionMembers(Integer selectionId, Integer[] ids)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
Integer[] ids;
Integer res = agent.AddSelectionMembers(selectionId, ids);
AddSelectionMembersFromSearch(Integer,String)
Adds members from the selection using the search result.
Declaration
Integer AddSelectionMembersFromSearch(Integer selectionId, String storageKey)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
String storageKey;
Integer res = agent.AddSelectionMembersFromSearch(selectionId, storageKey);
Copies contact selection members from selection into an existing selection.
Declaration
Void CopyContactSelectionMembers(Integer fromSelectionId, Integer toSelectionId)
Parameters
Returns
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
CopySelectionMembers(Integer,Integer)
Copies selection members from selection into an existing selection.
Declaration
Void CopySelectionMembers(Integer fromSelectionId, Integer toSelectionId)
Parameters
Returns
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
Creates a new selection based on selection members from an existing selection.
Declaration
NSSelectionEntity CreateContactSelectionFromSelection(Integer selectionId, String name, Integer targetSelectionType, Bool copyMembers)
Parameters
Returns
NSSelectionAgent agent;
Integer selectionId;
String name;
Integer targetSelectionType;
Bool copyMembers;
NSSelectionEntity res = agent.CreateContactSelectionFromSelection(selectionId, name, targetSelectionType, copyMembers);
Creates a new contact selection based on contact selection members from an existing shadow sale, appointment, project or document selection.
Declaration
NSSelectionEntity CreateContactSelectionFromShadowSelection(Integer selectionId, String name)
Parameters
Returns
NSSelectionAgent agent;
Integer selectionId;
String name;
NSSelectionEntity res = agent.CreateContactSelectionFromShadowSelection(selectionId, name);
CreateDefaultMailMergeSettings()
Sets default values into a new NSMailMergeSettings.
Declaration
NSMailMergeSettings CreateDefaultMailMergeSettings()
Returns
Examples
NSSelectionAgent agent;
NSMailMergeSettings thing = agent.CreateDefaultMailMergeSettings();
thing = agent.SaveMailMergeSettings(thing);
CreateDefaultMailMergeTask()
Sets default values into a new NSMailMergeTask.
Declaration
NSMailMergeTask CreateDefaultMailMergeTask()
Returns
Examples
NSSelectionAgent agent;
NSMailMergeTask thing = agent.CreateDefaultMailMergeTask();
thing = agent.SaveMailMergeTask(thing);
CreateDefaultSelectionEntity()
Sets default values into a new NSSelectionEntity.
Declaration
NSSelectionEntity CreateDefaultSelectionEntity()
Returns
Examples
NSSelectionAgent agent;
NSSelectionEntity thing = agent.CreateDefaultSelectionEntity();
thing = agent.SaveSelectionEntity(thing);
CreateNewEntry(NSDuplicateEntry)
Creates a new selection based on external duplicate
Declaration
Integer CreateNewEntry(NSDuplicateEntry duplicate)
Parameters
Returns
Examples
NSSelectionAgent agent;
NSDuplicateEntry duplicate;
Integer res = agent.CreateNewEntry(duplicate);
CreateSelectionEntity(String)
Creates (but do not save) a new selection entity, for the current user and the given target table; other fields populated as by CreateDefaultSelectionEntity()
Declaration
NSSelectionEntity CreateSelectionEntity(String targetTableName)
Parameters
Type |
Name |
Description |
String |
targetTableName |
|
Returns
Examples
NSSelectionAgent agent;
String targetTableName;
NSSelectionEntity res = agent.CreateSelectionEntity(targetTableName);
CreateSelectionFromSelection(Integer,String,Integer,Bool)
Creates a new selection based on selection members from an existing selection.
Declaration
NSSelectionEntity CreateSelectionFromSelection(Integer selectionId, String name, Integer targetSelectionType, Bool copyMembers)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
String name;
Integer targetSelectionType;
Bool copyMembers;
NSSelectionEntity res = agent.CreateSelectionFromSelection(selectionId, name, targetSelectionType, copyMembers);
Creates a temporary selection.
Declaration
NSSelectionEntity CreateTemporaryContactSelection()
Returns
NSSelectionAgent agent;
NSSelectionEntity res = agent.CreateTemporaryContactSelection();
Creates a temporary selection with members from a collection of ContactPerson IDs.
Declaration
NSSelectionEntity CreateTemporaryContactSelectionFromContactPersonIds(NSContactPersonId[] contactPersonIds)
Parameters
Type |
Name |
Description |
|
contactPersonIds |
|
Returns
NSSelectionAgent agent;
NSContactPersonId[] contactPersonIds;
NSSelectionEntity res = agent.CreateTemporaryContactSelectionFromContactPersonIds(contactPersonIds);
Creates a temporary selection with members from an existing project.
Declaration
NSSelectionEntity CreateTemporaryContactSelectionFromProjectMembers(Integer projectId)
Parameters
Type |
Name |
Description |
Integer |
projectId |
|
Returns
NSSelectionAgent agent;
Integer projectId;
NSSelectionEntity res = agent.CreateTemporaryContactSelectionFromProjectMembers(projectId);
Creates a temporary selection with members from a collection of selection-member IDs.
Declaration
NSSelectionEntity CreateTemporaryContactSelectionFromSelectionMemberIds(Integer selectionId, Integer[] selectionMemberIds)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Integer[] |
selectionMemberIds |
|
Returns
NSSelectionAgent agent;
Integer selectionId;
Integer[] selectionMemberIds;
NSSelectionEntity res = agent.CreateTemporaryContactSelectionFromSelectionMemberIds(selectionId, selectionMemberIds);
CreateTemporarySelectionFromIds(Integer[],Integer)
Creates a temporary selection with members from a collection of entity IDs.
Declaration
NSSelectionEntity CreateTemporarySelectionFromIds(Integer[] ids, Integer targetTableNumber)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer[] ids;
Integer targetTableNumber;
NSSelectionEntity res = agent.CreateTemporarySelectionFromIds(ids, targetTableNumber);
Deletes all contacts from a selection.
Declaration
Void DeleteContacts(Integer selectionId)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Returns
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
DeleteEntities(Integer)
Deletes all entities from a selection.
Declaration
Void DeleteEntities(Integer selectionId)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Returns
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
DeletePersons(Integer)
Deletes all persons from a selection.
Declaration
Void DeletePersons(Integer selectionId)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Returns
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
DeleteSelectionEntity(Integer)
Deletes the NSSelectionEntity
Declaration
DeleteSelectionEntity(Integer selectionEntity)
Parameters
Type |
Name |
Description |
Integer |
selectionEntity |
|
Returns
Examples
NSSelectionAgent agent;
agent.DeleteSelectionEntity(123);
Edits company and contact details in a selection based on contents in selectionMemberEditValues.
Declaration
Void EditContactSelectionMemberDetails(Integer selectionId, NSSelectionMemberEditValues selectionMemberEditValues)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
|
selectionMemberEditValues |
|
Returns
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
ExportSelectionMembers(Integer,String,Bool)
Generates a string that is the result of substituting the template variables with values from selection members.
Declaration
Byte[] ExportSelectionMembers(Integer selectionId, String templateName, Bool useContacts)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
String templateName;
Bool useContacts;
Byte[] res = agent.ExportSelectionMembers(selectionId, templateName, useContacts);
ExportSelectionMembersWithOrderBy(Integer,String,Bool,String)
Generates a string that is the result of substituting the template variables with values from selection members.
Declaration
Byte[] ExportSelectionMembersWithOrderBy(Integer selectionId, String templateName, Bool useContacts, String orderBy)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
String templateName;
Bool useContacts;
String orderBy;
Byte[] res = agent.ExportSelectionMembersWithOrderBy(selectionId, templateName, useContacts, orderBy);
GenerateFollowUps(Integer,NSAppointmentEntity,Integer,Bool,Bool)
Generates follow-ups for members in the selection.
Declaration
Void GenerateFollowUps(Integer selectionId, NSAppointmentEntity appointmentEntity, Integer associateId, Bool saveOnContactOwner, Bool uniqueContact)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
|
appointmentEntity |
|
Integer |
associateId |
|
Bool |
saveOnContactOwner |
|
Bool |
uniqueContact |
|
Returns
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
GetDuplicateRules()
Retrieves all available duplicate rules for selection
Declaration
NSDuplicateRule[] GetDuplicateRules()
Returns
Examples
NSSelectionAgent agent;
NSDuplicateRule[] res = agent.GetDuplicateRules();
GetDuplicates(String)
Gets duplicates(exact or similar in the database) based on the name
Declaration
NSDuplicateEntry[] GetDuplicates(String name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
Examples
NSSelectionAgent agent;
String name;
NSDuplicateEntry[] res = agent.GetDuplicates(name);
GetDynamicSelectionCriteria(Integer)
Gets the criteria for this dynamic selection.
Declaration
NSArchiveRestrictionInfo[] GetDynamicSelectionCriteria(Integer selectionId)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
NSArchiveRestrictionInfo[] res = agent.GetDynamicSelectionCriteria(selectionId);
GetDynamicSelectionCriteriaGroups(Integer)
Gets the criteria for this dynamic selection. This call supports multiple criteria groups.
Declaration
NSArchiveRestrictionGroup[] GetDynamicSelectionCriteriaGroups(Integer selectionId)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
NSArchiveRestrictionGroup[] res = agent.GetDynamicSelectionCriteriaGroups(selectionId);
GetParentCombinedSelections(Integer)
Gets a list of all selection ids where the given selection is used to create a combined selection.
Declaration
Integer[] GetParentCombinedSelections(Integer selectionId)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
Integer[] res = agent.GetParentCombinedSelections(selectionId);
GetRecipientStatistics(Integer)
Returns an NSRecipientStatistics object with a count of addresses and email addresses.
Declaration
NSRecipientStatistics GetRecipientStatistics(Integer selectionId)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
NSRecipientStatistics res = agent.GetRecipientStatistics(selectionId);
Returns an NSRecipientStatistics object with a count of addresses and email addresses based on contact and persons in a collection of ContactPersonId.
Declaration
NSRecipientStatistics GetRecipientStatisticsFromContactPersonIds(NSContactPersonId[] contactPersonIds)
Returns
NSSelectionAgent agent;
NSContactPersonId[] contactPersonIds;
NSRecipientStatistics res = agent.GetRecipientStatisticsFromContactPersonIds(contactPersonIds);
GetRecipientStatisticsFromProjectMembers(Integer)
Returns an NSRecipientStatistics object with a count of addresses and email addresses based on members in a project.
Declaration
NSRecipientStatistics GetRecipientStatisticsFromProjectMembers(Integer projectId)
Parameters
Type |
Name |
Description |
Integer |
projectId |
|
Returns
Examples
NSSelectionAgent agent;
Integer projectId;
NSRecipientStatistics res = agent.GetRecipientStatisticsFromProjectMembers(projectId);
GetSelectionEntity(Integer)
Gets an NSSelectionEntity object.
Declaration
NSSelectionEntity GetSelectionEntity(Integer selectionEntityId)
Parameters
Type |
Name |
Description |
Integer |
selectionEntityId |
|
Returns
Examples
NSSelectionAgent agent;
NSSelectionEntity thing = agent.GetSelectionEntity(123);
GetSelectionForFind(String,Integer)
Obtains a selection for the given entity, for the current user, of type WorkingSetForFind.
Declaration
NSSelectionForFind GetSelectionForFind(String entityName, Integer typicalSearchId)
Parameters
Type |
Name |
Description |
String |
entityName |
|
Integer |
typicalSearchId |
Optionally populate criteria from the TypicalSearches system.
|
Returns
Examples
NSSelectionAgent agent;
String entityName;
Integer typicalSearchId;
NSSelectionForFind res = agent.GetSelectionForFind(entityName, typicalSearchId);
GetSelectionMembersArchiveRows(Integer,String)
Gets the list of members in this selection. The type of members depends on the target table of the selection.
Declaration
NSArchiveListItem[] GetSelectionMembersArchiveRows(Integer selectionId, String select)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
String select;
NSArchiveListItem[] res = agent.GetSelectionMembersArchiveRows(selectionId, select);
GetSelectionShadowMembersArchiveRows(Integer,String)
Gets the list of members in this selection's shadow (i.e. the list of contacts + persons referenced in the main selection).
Declaration
NSArchiveListItem[] GetSelectionShadowMembersArchiveRows(Integer selectionId, String select)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
String select;
NSArchiveListItem[] res = agent.GetSelectionShadowMembersArchiveRows(selectionId, select);
Removes members from the selection as specified in the collection of ContactPersonId.
Declaration
Void RemoveContactSelectionMembers(Integer selectionId, NSContactPersonId[] contactPersonIds)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
|
contactPersonIds |
|
Returns
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
Removes members from the selection using a collection a selection-member IDs.
Declaration
Void RemoveContactSelectionMembersFromIds(Integer selectionId, Integer[] selectionMembersIds)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Integer[] |
selectionMembersIds |
|
Returns
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
Removes members from the selection using the search result.
Declaration
Integer RemoveContactSelectionMembersFromSearch(Integer selectionId, String storageKey)
Parameters
Returns
NSSelectionAgent agent;
Integer selectionId;
String storageKey;
Integer res = agent.RemoveContactSelectionMembersFromSearch(selectionId, storageKey);
RemoveSelectionMembers(Integer,Integer[])
Removes members from the selection as specified in the collection of entity IDs. The IDs are selection member IDs (selection member primary key)
Declaration
Void RemoveSelectionMembers(Integer selectionId, Integer[] selectionMemberIds)
Parameters
Type |
Name |
Description |
Integer |
selectionId |
|
Integer[] |
selectionMemberIds |
|
Returns
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
RemoveSelectionMembersById(Integer,Integer[])
Removes members from the selection as specified in the collection of entity IDs. The IDs can be a collection of sale IDs, or other supported types.
Declaration
Void RemoveSelectionMembersById(Integer selectionId, Integer[] ids)
Parameters
Returns
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
RemoveSelectionMembersFromSearch(Integer,String)
Removes members from the selection using the search result.
Declaration
Integer RemoveSelectionMembersFromSearch(Integer selectionId, String storageKey)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
String storageKey;
Integer res = agent.RemoveSelectionMembersFromSearch(selectionId, storageKey);
SaveSelectionEntity(NSSelectionEntity)
Updates the existing NSSelectionEntity or creates a new NSSelectionEntity if the ID parameter is 0.
Declaration
NSSelectionEntity SaveSelectionEntity(NSSelectionEntity selectionEntity)
Parameters
Returns
Examples
NSSelection agent;
NSSelectionEntity thing = agent.CreateDefaultSelectionEntity();
thing = agent.SaveSelectionEntity(thing);
SetDuplicateRulesStatus(NSDuplicateRule[])
Sets which duplicate rules should be active or not
Declaration
Void SetDuplicateRulesStatus(NSDuplicateRule[] rules)
Parameters
Returns
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
SetDynamicSelectionCriteria(Integer,NSArchiveRestrictionInfo[])
Updates the criteria for this dynamic selection. Replaces existing criteria with the new values.
Declaration
NSArchiveRestrictionInfo[] SetDynamicSelectionCriteria(Integer selectionId, NSArchiveRestrictionInfo[] criteria)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
NSArchiveRestrictionInfo[] criteria;
NSArchiveRestrictionInfo[] res = agent.SetDynamicSelectionCriteria(selectionId, criteria);
SetDynamicSelectionCriteria2(Integer,String)
Updates the criteria for this dynamic selection using string.
Declaration
NSArchiveRestrictionInfo[] SetDynamicSelectionCriteria2(Integer selectionId, String filter)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
String filter;
NSArchiveRestrictionInfo[] res = agent.SetDynamicSelectionCriteria2(selectionId, filter);
SetDynamicSelectionCriteria3(Integer,NSArchiveRestrictionInfo[],String)
Updates the criteria for this dynamic selection. Use criteria as either restriction objects or OData string format.
Declaration
NSArchiveRestrictionInfo[] SetDynamicSelectionCriteria3(Integer selectionId, NSArchiveRestrictionInfo[] criteria, String filter)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
NSArchiveRestrictionInfo[] criteria;
String filter;
NSArchiveRestrictionInfo[] res = agent.SetDynamicSelectionCriteria3(selectionId, criteria, filter);
SetDynamicSelectionCriteriaGroups(Integer,NSArchiveRestrictionGroup[])
Updates the criteria for this dynamic selection. Replaces existing criteria with the new values. This call supports multiple criteria groups.
Declaration
NSArchiveRestrictionGroup[] SetDynamicSelectionCriteriaGroups(Integer selectionId, NSArchiveRestrictionGroup[] criteria)
Parameters
Returns
Examples
NSSelectionAgent agent;
Integer selectionId;
NSArchiveRestrictionGroup[] criteria;
NSArchiveRestrictionGroup[] res = agent.SetDynamicSelectionCriteriaGroups(selectionId, criteria);
StartMailMerge(MailMergeSettings)
Starts a mail-merge operation with specified settings.
Declaration
Void StartMailMerge(MailMergeSettings settings)
Parameters
Type |
Name |
Description |
|
settings |
|
Returns
Examples
NSSelectionAgent agent;
agent.callMethod(arg1, arg2);
UpdateTypicalSearch(NSTypicalSearches)
Updates (imports) TypicalSearch information in the database
Declaration
String UpdateTypicalSearch(NSTypicalSearches searches)
Parameters
Type |
Name |
Description |
|
searches |
|
Returns
Examples
NSSelectionAgent agent;
NSTypicalSearches searches;
String res = agent.UpdateTypicalSearch(searches);