Interface ISelectionAgent
Interface for the Selection Agent Selections, entities, members and tasks
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Selection Agent", "Interface for the Selection Agent. Selections, entities, members and tasks")]
public interface ISelectionAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
Methods
AddContactSelectionMembersAsync(int, ContactPersonId[], CancellationToken)
Adds the collection of ContactPersonId as members to the static selection
Declaration
Task AddContactSelectionMembersAsync(int selectionId, ContactPersonId[] contactPersonIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection where to members will be added to. |
ContactPersonId[] | contactPersonIds | A collection of ContactPersonId to add to the selection. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
AddContactSelectionMembersFromSearchAsync(int, string, CancellationToken)
Adds members to the selection from the search result.
Declaration
Task<int> AddContactSelectionMembersFromSearchAsync(int selectionId, string storageKey, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add members |
string | storageKey | Storage key to be interpreted by the restriction storage provider, when it fetches criteria for the search |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Number of members added |
AddRemoveContactSelectionMemberInterestsAsync(int, int[], int[], int[], int[], CancellationToken)
Adds or removes interests on companies and persons in a selection.
Declaration
Task AddRemoveContactSelectionMemberInterestsAsync(int selectionId, int[] addCompanyInterests, int[] removeCompanyInterests, int[] addContactInterests, int[] removeContactInterests, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add or remove interests members from. |
int[] | addCompanyInterests | Array of int containing the id's of the interests to add to the company. |
int[] | removeCompanyInterests | Array of int containing the id's of the interests to remove from the company. |
int[] | addContactInterests | Array of int containing the id's of the interests to add to the contact. |
int[] | removeContactInterests | Array of int containing the id's of the interests to remove from the contact. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
AddSelectionMembersAsync(int, int[], CancellationToken)
Add selection members to a static selection of type others than contacts.
Declaration
Task<int> AddSelectionMembersAsync(int selectionId, int[] ids, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The selection id to add the members to. |
int[] | ids | Collection of ids to add to the selection. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Returns number of members added to the selection. |
AddSelectionMembersFromSearchAsync(int, string, CancellationToken)
Adds members from the selection using the search result.
Declaration
Task<int> AddSelectionMembersFromSearchAsync(int selectionId, string storageKey, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add members |
string | storageKey | Storage key to be interpreted by the restriction storage provider, when it fetches criteria for the search |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Number of members added. |
CopyContactSelectionMembersAsync(int, int, CancellationToken)
Copy contact selection members from selection into an existing selection.
Declaration
Task CopyContactSelectionMembersAsync(int fromSelectionId, int toSelectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | fromSelectionId | The id of the selection to copy members from. |
int | toSelectionId | The id of the selection to copy members to. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
CopySelectionMembersAsync(int, int, CancellationToken)
Copy selection members from selection into an existing selection.
Declaration
Task CopySelectionMembersAsync(int fromSelectionId, int toSelectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | fromSelectionId | The id of the selection to copy members from. |
int | toSelectionId | The id of the selection to copy members to. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
CreateContactSelectionFromSelectionAsync(int, string, SelectionType, bool, CancellationToken)
Creates a new selection based on selection members from an existing selection.
Declaration
Task<SelectionEntity> CreateContactSelectionFromSelectionAsync(int selectionId, string name, SelectionType targetSelectionType, bool copyMembers, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to copy members from. |
string | name | The name of the new selection. |
SelectionType | targetSelectionType | The type of ContactSelection to create. The type can be static or dynamic. If the original selection to copy from is static, the SelectionType can only be static. If the original selection is dynamic, both a static and dynamic selection can be created. |
bool | copyMembers | If true, the members from the original selection will be added to the newly created selection. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | Returns the newly created SelectionEntity. |
CreateContactSelectionFromShadowSelectionAsync(int, string, CancellationToken)
Creates a new contact selection based on contact selection members from an existing shadow sale, appointment, project or document selection. The new selection will always be static even if the original selection is dynamic.
Declaration
Task<SelectionEntity> CreateContactSelectionFromShadowSelectionAsync(int selectionId, string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to copy members from. |
string | name | The name of the new selection. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | Returns the newly created SelectionEntity. |
CreateDefaultSelectionEntityAsync(CancellationToken)
Loading default values into a new SelectionEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
Task<SelectionEntity> CreateDefaultSelectionEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | New SelectionEntity with default values |
CreateNewEntryAsync(DuplicateEntry, CancellationToken)
Creates a new selection based on external duplicate
Declaration
Task<int> CreateNewEntryAsync(DuplicateEntry duplicate, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DuplicateEntry | duplicate | The duplicate to create a new entry based upon |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | The database identity of the newly created entry |
CreateSelectionEntityAsync(string, CancellationToken)
Create (but do not save) a new selection entity, for the current user and the given target table; other fields populated as by CreateDefaultSelectionEntity()
Declaration
Task<SelectionEntity> CreateSelectionEntityAsync(string targetTableName, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | targetTableName | The name of the target table, such as 'contact' or 'appointment'; any table for which Selection functionality is enabled |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | The new SelectionEntity, which has not yet been saved |
CreateSelectionFromSelectionAsync(int, string, SelectionType, bool, CancellationToken)
Creates a new selection based on selection members from an existing selection.
Declaration
Task<SelectionEntity> CreateSelectionFromSelectionAsync(int selectionId, string name, SelectionType targetSelectionType, bool copyMembers, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to copy members from. |
string | name | The name of the new selection. |
SelectionType | targetSelectionType | The type of Selection to create. The type can be static or dynamic. If the original selection to copy from is static, the SelectionType can only be static. If the original selection is dynamic, both a static and dynamic selection can be created. |
bool | copyMembers | If true, the members from the original selection will be added to the newly created selection. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | Returns the newly created SelectionEntity. |
CreateTemporaryContactSelectionAsync(CancellationToken)
Creates a temporary selection.
Declaration
Task<SelectionEntity> CreateTemporaryContactSelectionAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | Returns the newly created SelectionEntity. |
CreateTemporaryContactSelectionFromContactPersonIdsAsync(ContactPersonId[], CancellationToken)
Creates a temporary selection with members from a collection of ContactPerson id's.
Declaration
Task<SelectionEntity> CreateTemporaryContactSelectionFromContactPersonIdsAsync(ContactPersonId[] contactPersonIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ContactPersonId[] | contactPersonIds | A collection of ContactPersonId to copy into the temporary contact selection as members. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | Returns the newly created SelectionEntity. |
CreateTemporaryContactSelectionFromSelectionMemberIdsAsync(int, int[], CancellationToken)
Creates a temporary selection with members from a collection of selectionmember id's.
Declaration
Task<SelectionEntity> CreateTemporaryContactSelectionFromSelectionMemberIdsAsync(int selectionId, int[] selectionMemberIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The selectionId the selectionmembers is a part of. |
int[] | selectionMemberIds | A collection of int ids to copy into the temporary contact selection as members. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | Returns the newly created SelectionEntity. |
CreateTemporarySelectionFromIdsAsync(int[], int, CancellationToken)
Creates a temporary selection with members from a collection of entity id's.
Declaration
Task<SelectionEntity> CreateTemporarySelectionFromIdsAsync(int[] ids, int targetTableNumber, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | ids | A collection of Ids to copy into the temporary selection as members. The ids are primary keys of entities defined by the targetTableNumber parameter. |
int | targetTableNumber | The type of selection to create. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | Returns the newly created SelectionEntity. |
DeleteContactsAsync(int, CancellationToken)
Deletes all contacts from a selection. If a contact does not have delete rights, it will be skipped.
Declaration
Task DeleteContactsAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | Id of the selection the delete operation will be performed. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteEntitiesAsync(int, CancellationToken)
Deletes all entities from a selection. If an entity does not have delete rights, it will be skipped.
Declaration
Task DeleteEntitiesAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | Id of the selection the delete operation will be performed. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeletePersonsAsync(int, CancellationToken)
Deletes all persons from a selection. If a person does not have delete rights, it will be skipped.
Declaration
Task DeletePersonsAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | Id of the selection the delete operation will be performed. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
DeleteSelectionEntityAsync(int, CancellationToken)
Deletes the SelectionEntity
Declaration
Task DeleteSelectionEntityAsync(int selectionEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionEntityId | The identity of the SelectionEntity |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | This method has no return value |
EditContactSelectionMemberDetailsAsync(int, SelectionMemberEditValues, CancellationToken)
Edit company and contact details in a selection based on contents in selectionMemberEditValues.
Declaration
Task EditContactSelectionMemberDetailsAsync(int selectionId, SelectionMemberEditValues selectionMemberEditValues, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to edit members from. |
SelectionMemberEditValues | selectionMemberEditValues | An object of <see cref="SelectionMemberEditValues"/> describing what should be changed for companys and contacts. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
ExportSelectionMembersAsync(int, string, bool, CancellationToken)
ExportSelectionMembers will generate a string that is the result of substituting the template variables with values from selectionmembers.
Declaration
Task<byte[]> ExportSelectionMembersAsync(int selectionId, string templateName, bool useContacts, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to generate the exported file. |
string | templateName | The templateName parameter is the relative path of a .sxf file template. The .sxf files can be found in \template or in the user folder of the so archive. |
bool | useContacts | If the selection contains other members than contacts, setting this to true will export the contact archive of the selection. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<byte[]> | Returns a unicode byte array with the file to export to the user. |
ExportSelectionMembersWithOrderByAsync(int, string, bool, string, CancellationToken)
ExportSelectionMembers will generate a string that is the result of substituting the template variables with values from selectionmembers.
Declaration
Task<byte[]> ExportSelectionMembersWithOrderByAsync(int selectionId, string templateName, bool useContacts, string orderBy, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to generate the exported file. |
string | templateName | The templateName parameter is the relative path of a .sxf file template. The .sxf files can be found in \template or in the user folder of the so archive. |
bool | useContacts | If the selection contains other members than contacts, setting this to true will export the contact archive of the selection. |
string | orderBy | OrderBy. <Column,OrderBySortType> |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<byte[]> | Returns a unicode byte array with the file to export to the user. |
GenerateFollowUpsAsync(int, AppointmentEntity, int, bool, bool, CancellationToken)
Generate follow-ups for members in the selection.
Declaration
Task GenerateFollowUpsAsync(int selectionId, AppointmentEntity appointmentEntity, int associateId, bool saveOnContactOwner, bool uniqueContact, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to generate the follow-ups for. |
AppointmentEntity | appointmentEntity | The AppointmentEntity with information about the appointment. |
int | associateId | The associate to save the appointments on. If saveOnContactOwner is true, this id will be ignored. Appointments wil be saved on current user if associateId = 0. |
bool | saveOnContactOwner | If true, the appointments will be saved on contact owner (Our contact). This parameter will override associateId if true. |
bool | uniqueContact | If true, only one appointment will be created for each contact. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
GetDuplicateRulesAsync(CancellationToken)
Retrieve all available duplicate rules for selection
Declaration
Task<DuplicateRule[]> GetDuplicateRulesAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DuplicateRule[]> | All available duplicate rules |
GetDuplicatesAsync(string, CancellationToken)
Get duplicates(exact or similar in the database) based on the name
Declaration
Task<DuplicateEntry[]> GetDuplicatesAsync(string name, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | name | Name used for lookup |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<DuplicateEntry[]> | Any records matching the specified name |
GetDynamicSelectionCriteriaAsync(int, CancellationToken)
Get the criteria for this dynamic selection.
Declaration
Task<ArchiveRestrictionInfo[]> GetDynamicSelectionCriteriaAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add members |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ArchiveRestrictionInfo[]> | Criteria defining the selection result. NULL if selection does not exist, or if this is not a dynamic selection. |
GetDynamicSelectionCriteriaGroupsAsync(int, CancellationToken)
Get the criteria for this dynamic selection. This call supports multiple criteria groups.
Declaration
Task<ArchiveRestrictionGroup[]> GetDynamicSelectionCriteriaGroupsAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add members |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ArchiveRestrictionGroup[]> | Criteria groups defining the selection result. NULL if selection does not exist, or if this is not a dynamic selection. |
GetParentCombinedSelectionsAsync(int, CancellationToken)
Get a list of all selection ids where the given selection is used to create a combined selection.
Declaration
Task<int[]> GetParentCombinedSelectionsAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The selectionId to query for. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int[]> | Array of selectionIds. |
GetRecipientStatisticsAsync(int, CancellationToken)
Returns a RecipientStatistics object with a count of addresses, emailaddresses and emailaddresses.
Declaration
Task<RecipientStatistics> GetRecipientStatisticsAsync(int selectionId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to get the statistics for. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<RecipientStatistics> | Returns a RecipientStatistics object. |
GetRecipientStatisticsFromContactPersonIdsAsync(ContactPersonId[], CancellationToken)
Returns a RecipientStatistics object with a count of addresses, emailaddresses and emailaddresses based on contact and persons in a collection of ContactPersonId.
Declaration
Task<RecipientStatistics> GetRecipientStatisticsFromContactPersonIdsAsync(ContactPersonId[] contactPersonIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ContactPersonId[] | contactPersonIds | A collection of ContactPersonId to get the statistics for. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<RecipientStatistics> | Returns a RecipientStatistics object. |
GetRecipientStatisticsFromProjectMembersAsync(int, CancellationToken)
Returns a RecipientStatistics object with a count of addresses, emailaddresses and emailaddresses based on members in a project.
Declaration
Task<RecipientStatistics> GetRecipientStatisticsFromProjectMembersAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The id of the project to get the member statistics for. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<RecipientStatistics> | Returns a RecipientStatistics object. |
GetSelectionEntityAsync(int, CancellationToken)
Gets a SelectionEntity object.
Declaration
Task<SelectionEntity> GetSelectionEntityAsync(int selectionEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionEntityId | The identifier of the SelectionEntity object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | SelectionEntity |
GetSelectionForFindAsync(string, int, CancellationToken)
Obtain a selection for the given entity, for the current user, of type WorkingSetForFind. Optionally populate criteria from the TypicalSearches system
Declaration
Task<SelectionForFind> GetSelectionForFindAsync(string entityName, int typicalSearchId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | entityName | The name of the entity to make a selection for; examples 'sale', 'project', 'y_equipment' |
int | typicalSearchId | If 0, keep existing criteria; if -1, reset to entity default; > 0 get criteria from given TypicalSearch |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionForFind> | Target selection id and provider name |
GetSelectionMembersArchiveRowsAsync(int, string, CancellationToken)
Get the list of members in this selection. The type of members depends on the target table of the selection.
Declaration
Task<ArchiveListItem[]> GetSelectionMembersArchiveRowsAsync(int selectionId, string select, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The selectionId we want selection members for. |
string | select | (optional) Comma separated Column names to include in result. List of columns varies depending on the selection's TargetTable. e.g. 'name', 'firstname', 'startTime' |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ArchiveListItem[]> | Array of archive rows, where each item represents one row of data (row level data + the requested columns). NULL if selection does not exist. |
GetSelectionShadowMembersArchiveRowsAsync(int, string, CancellationToken)
Get the list of members in this selection's shadow (i.e. the list of contacts + persons referenced in the main selection).
Declaration
Task<ArchiveListItem[]> GetSelectionShadowMembersArchiveRowsAsync(int selectionId, string select, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The selectionId we want selection members for. |
string | select | (optional) Comma separated Column names to include in result. List of columns varies depending on the selection's TargetTable. e.g. 'name', 'firstname,name', 'startTime,firstname,name' |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ArchiveListItem[]> | Array of archive rows, where each item represents one row of data (row level data + the requested columns). NULL if selection does not exist. |
GetSelectionSummariesAsync(int[], CancellationToken)
Get an array of summaryitem for the given selections
Declaration
Task<SelectionSummaryItem[]> GetSelectionSummariesAsync(int[] selectionIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int[] | selectionIds | The selections to fetch summaries for |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionSummaryItem[]> | Summary items for the given id's, in no particular order |
RemoveContactSelectionMembersAsync(int, ContactPersonId[], CancellationToken)
Removes members from the selection as specified in the collection of ContactPersonId.
Declaration
Task RemoveContactSelectionMembersAsync(int selectionId, ContactPersonId[] contactPersonIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection where to members will be removed. |
ContactPersonId[] | contactPersonIds | A collection of ContactPersonId to remove from the static selection. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
RemoveContactSelectionMembersFromIdsAsync(int, int[], CancellationToken)
Removes members from the selection using a collection a selectionmember id's. Members can only be removed from single selection.
Declaration
Task RemoveContactSelectionMembersFromIdsAsync(int selectionId, int[] selectionMembersIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection where to members will be removed. |
int[] | selectionMembersIds | An array of selectionmember id's to remove from the selection. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
RemoveContactSelectionMembersFromSearchAsync(int, string, CancellationToken)
Removes members from the selection using the search result.
Declaration
Task<int> RemoveContactSelectionMembersFromSearchAsync(int selectionId, string storageKey, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to remove members. |
string | storageKey | Storage key to be interpreted by the restriction storage provider, when it fetches criteria for the search. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Number of members removed |
RemoveSelectionMembersAsync(int, int[], CancellationToken)
Removes members from the selection as specified in the collection of entity ids. The ids are selection member ids (selection member primary key)
Declaration
Task RemoveSelectionMembersAsync(int selectionId, int[] selectionMemberIds, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection where to members will be removed. |
int[] | selectionMemberIds | Selection member primary keys |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
RemoveSelectionMembersByIdAsync(int, int[], CancellationToken)
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
Task RemoveSelectionMembersByIdAsync(int selectionId, int[] ids, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection where to members will be removed. |
int[] | ids | A collection of sale/project/contact ids to remove from the selection. The ids can be a collection of sale ids, or other supported types. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
RemoveSelectionMembersFromSearchAsync(int, string, CancellationToken)
Removes members from the selection using the search result.
Declaration
Task<int> RemoveSelectionMembersFromSearchAsync(int selectionId, string storageKey, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to remove members. |
string | storageKey | Storage key to be interpreted by the restriction storage provider, when it fetches criteria for the search. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Number of members removed |
SaveSelectionEntityAsync(SelectionEntity, CancellationToken)
Updates the existing SelectionEntity or creates a new SelectionEntity if the id parameter is empty
Declaration
Task<SelectionEntity> SaveSelectionEntityAsync(SelectionEntity selectionEntity, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
SelectionEntity | selectionEntity | The SelectionEntity that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<SelectionEntity> | New or updated SelectionEntity |
SetDuplicateRulesStatusAsync(DuplicateRule[], CancellationToken)
Set which duplicate rules should be active or not
Declaration
Task SetDuplicateRulesStatusAsync(DuplicateRule[] rules, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
DuplicateRule[] | rules | Duplicate rules to update active status for |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
SetDynamicSelectionCriteria2Async(int, string, CancellationToken)
Update the criteria for this dynamic selection using string. Criteria are parsed from the OData filter form: ''name startswith 'foo' and category in (1,2,3)''
Declaration
Task<ArchiveRestrictionInfo[]> SetDynamicSelectionCriteria2Async(int selectionId, string filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add members |
string | filter | Criteria defining the selection result in OData filter form: |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ArchiveRestrictionInfo[]> | Criteria defining the selection result. NULL if this is not a dynamic selection. |
Examples
"name = 'SuperOffice AS'"
"name startsWith 'SuperOffice'"
"startsWith(name, 'SuperOffice')"
"updatedDate after '2000.12.30'"
"category = 10"
"category in (10, 12, 53)"
"category in (2,3,4) and name startswith 'super'"
"category in (2,3,4) or name startswith 'super'"
"(category = 2 or business = 3) and name contains 'super'"
var agent = new FindAgent();
var res1 = agent.FindFromRestrictions2("updatedBy = 2", "FindContact", 100, 0);
foreach (var row in res1.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue == 2
var res2 = agent.FindFromRestrictions2("updatedBy unequals 6 and updatedDate after '2000.1.2'", "FindContact", 100, 0);
foreach (var row in res2.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue != 6 &&
row.ColumnData["updatedDate"].GetDateTimeValue() > new DateTime(2000, 1, 2);
var res3 = agent.FindFromRestrictions2("category in (2,3)", "FindContact", 100, 0);
foreach (var row in res3.ArchiveRows)
(int)row.ColumnData["category"].RawValue == 2 || (int)row.ColumnData["category"].RawValue == 3;
var res4 = agent.FindFromRestrictions2("sale/date after '2000.1.2'", "FindContact", 100, 0);
foreach (var row in res4.ArchiveRows)
(row.ColumnData["sale/date"].GetDateTimeValue().Year >= 2000
var res5 = _agent.FindFromRestrictionsColumns2("(category =2 or business = 3) and name contains 'e'",
_provider, "category,business,name", 100, 0);
foreach (var row in res5.ArchiveRows)
((int)x.ColumnData["category"].RawValue == 2 ||
(int)x.ColumnData["business"].RawValue == 3) &&
(x.ColumnData["name"].RawValue as string).Contains("e") );
SetDynamicSelectionCriteria3Async(int, ArchiveRestrictionInfo[], string, CancellationToken)
Update the criteria for this dynamic selection. Use criteria as either restriction objects or OData string format. Criteria are parsed from the OData filter form: ''name startswith 'foo' and category in (1,2,3)''
Declaration
Task<ArchiveRestrictionInfo[]> SetDynamicSelectionCriteria3Async(int selectionId, ArchiveRestrictionInfo[] criteria, string filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add members |
ArchiveRestrictionInfo[] | criteria | Criteria defining the selection result. Pass NULL if using the filter string instead. |
string | filter | Criteria defining the selection result in OData filter form: |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ArchiveRestrictionInfo[]> | Criteria defining the selection result. NULL if this is not a dynamic selection. |
Examples
"name = 'SuperOffice AS'"
"name startsWith 'SuperOffice'"
"startsWith(name, 'SuperOffice')"
"updatedDate after '2000.12.30'"
"category = 10"
"category in (10, 12, 53)"
"category in (2,3,4) and name startswith 'super'"
"category in (2,3,4) or name startswith 'super'"
"(category = 2 or business = 3) and name contains 'super'"
var agent = new FindAgent();
var restrictions = new ArchiveRestrictionInfo[1];
restrictions[0] = new ArchiveRestrictionInfo("updatedBy", "equals", "2");
var res = _agent.FindFromRestrictions(restrictions, "FindContact", 100, 0);
foreach (var row in res1.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue == 2
var restrictions = new ArchiveRestrictionInfo[2];
restrictions[0] = new ArchiveRestrictionInfo("updatedBy", "equals", "2");
restrictions[1] = new ArchiveRestrictionInfo("updatedDate", "after", "2000.1.2");
var res = _agent.FindFromRestrictions(restrictions, "FindContact", 100, 0);
foreach (var row in res2.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue != 6 &&
row.ColumnData["updatedDate"].GetDateTimeValue() > new DateTime(2000, 1, 2);
"name = 'SuperOffice AS'"
"name startsWith 'SuperOffice'"
"startsWith(name, 'SuperOffice')"
"updatedDate after '2000.12.30'"
"category = 10"
"category in (10, 12, 53)"
"category in (2,3,4) and name startswith 'super'"
"category in (2,3,4) or name startswith 'super'"
"(category = 2 or business = 3) and name contains 'super'"
var agent = new FindAgent();
var res1 = agent.FindFromRestrictions2("updatedBy = 2", "FindContact", 100, 0);
foreach (var row in res1.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue == 2
var res2 = agent.FindFromRestrictions2("updatedBy unequals 6 and updatedDate after '2000.1.2'", "FindContact", 100, 0);
foreach (var row in res2.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue != 6 &&
row.ColumnData["updatedDate"].GetDateTimeValue() > new DateTime(2000, 1, 2);
var res3 = agent.FindFromRestrictions2("category in (2,3)", "FindContact", 100, 0);
foreach (var row in res3.ArchiveRows)
(int)row.ColumnData["category"].RawValue == 2 || (int)row.ColumnData["category"].RawValue == 3;
var res4 = agent.FindFromRestrictions2("sale/date after '2000.1.2'", "FindContact", 100, 0);
foreach (var row in res4.ArchiveRows)
(row.ColumnData["sale/date"].GetDateTimeValue().Year >= 2000
var res5 = _agent.FindFromRestrictionsColumns2("(category =2 or business = 3) and name contains 'e'",
_provider, "category,business,name", 100, 0);
foreach (var row in res5.ArchiveRows)
((int)x.ColumnData["category"].RawValue == 2 ||
(int)x.ColumnData["business"].RawValue == 3) &&
(x.ColumnData["name"].RawValue as string).Contains("e") );
SetDynamicSelectionCriteriaAsync(int, ArchiveRestrictionInfo[], CancellationToken)
Update the criteria for this dynamic selection. Replaces existing criteria with the new values.
Declaration
Task<ArchiveRestrictionInfo[]> SetDynamicSelectionCriteriaAsync(int selectionId, ArchiveRestrictionInfo[] criteria, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add members |
ArchiveRestrictionInfo[] | criteria | Criteria defining the selection result. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ArchiveRestrictionInfo[]> | Criteria defining the selection result. NULL if this is not a dynamic selection. |
Examples
"name = 'SuperOffice AS'"
"name startsWith 'SuperOffice'"
"startsWith(name, 'SuperOffice')"
"updatedDate after '2000.12.30'"
"category = 10"
"category in (10, 12, 53)"
"category in (2,3,4) and name startswith 'super'"
"category in (2,3,4) or name startswith 'super'"
"(category = 2 or business = 3) and name contains 'super'"
var agent = new FindAgent();
var restrictions = new ArchiveRestrictionInfo[1];
restrictions[0] = new ArchiveRestrictionInfo("updatedBy", "equals", "2");
var res = _agent.FindFromRestrictions(restrictions, "FindContact", 100, 0);
foreach (var row in res1.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue == 2
var restrictions = new ArchiveRestrictionInfo[2];
restrictions[0] = new ArchiveRestrictionInfo("updatedBy", "equals", "2");
restrictions[1] = new ArchiveRestrictionInfo("updatedDate", "after", "2000.1.2");
var res = _agent.FindFromRestrictions(restrictions, "FindContact", 100, 0);
foreach (var row in res2.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue != 6 &&
row.ColumnData["updatedDate"].GetDateTimeValue() > new DateTime(2000, 1, 2);
SetDynamicSelectionCriteriaGroupsAsync(int, ArchiveRestrictionGroup[], CancellationToken)
Update the criteria for this dynamic selection. Replaces existing criteria with the new values. This call supports multiple criteria groups.
Declaration
Task<ArchiveRestrictionGroup[]> SetDynamicSelectionCriteriaGroupsAsync(int selectionId, ArchiveRestrictionGroup[] criteria, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | selectionId | The id of the selection to add members |
ArchiveRestrictionGroup[] | criteria | Criteria groups defining the selection result. Empty array is legal, simply means no criteria have been set |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<ArchiveRestrictionGroup[]> | Criteria groups defining the selection result. NULL if this is not a dynamic selection. |
Examples
"name = 'SuperOffice AS'"
"name startsWith 'SuperOffice'"
"startsWith(name, 'SuperOffice')"
"updatedDate after '2000.12.30'"
"category = 10"
"category in (10, 12, 53)"
"category in (2,3,4) and name startswith 'super'"
"category in (2,3,4) or name startswith 'super'"
"(category = 2 or business = 3) and name contains 'super'"
var agent = new FindAgent();
var restrictions = new ArchiveRestrictionInfo[1];
restrictions[0] = new ArchiveRestrictionInfo("updatedBy", "equals", "2");
var res = _agent.FindFromRestrictions(restrictions, "FindContact", 100, 0);
foreach (var row in res1.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue == 2
var restrictions = new ArchiveRestrictionInfo[2];
restrictions[0] = new ArchiveRestrictionInfo("updatedBy", "equals", "2");
restrictions[1] = new ArchiveRestrictionInfo("updatedDate", "after", "2000.1.2");
var res = _agent.FindFromRestrictions(restrictions, "FindContact", 100, 0);
foreach (var row in res2.ArchiveRows)
(int)row.ColumnData["updatedBy"].RawValue != 6 &&
row.ColumnData["updatedDate"].GetDateTimeValue() > new DateTime(2000, 1, 2);
UpdateTypicalSearchAsync(TypicalSearches, CancellationToken)
Update (import) TypicalSearch information in the database
Declaration
Task<string> UpdateTypicalSearchAsync(TypicalSearches searches, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
TypicalSearches | searches | TypicalSearch structures to import. If null, then the fileset is scanned for *TypicalSearch.json files and those are imported instead |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> | Message that can be shown to the user, summarizing what has been done, if anything. |