Class SelectionAgent
Facade for the Selection Agent Selections, entities, members and tasks
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class SelectionAgent : AgentBase<ISelectionAgent>, IDisposable, 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...
}
}
Constructors
SelectionAgent()
Facade for the Selection Agent Selections, entities, members and tasks
Declaration
public SelectionAgent()
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
AddContactSelectionMembers(Int32, ContactPersonId[])
Adds the collection of ContactPersonId as members to the static selection
Declaration
public void AddContactSelectionMembers(int selectionId, ContactPersonId[] contactPersonIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection where to members will be added to. |
ContactPersonId[] | contactPersonIds | A collection of ContactPersonId to add to the selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
AddContactSelectionMembersFromSearch(Int32, String)
Adds members to the selection from the search result.
Declaration
public int AddContactSelectionMembersFromSearch(int selectionId, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
Int32 | Number of members added |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
AddRemoveContactSelectionMemberInterests(Int32, Int32[], Int32[], Int32[], Int32[])
Adds or removes interests on companies and persons in a selection.
Declaration
public void AddRemoveContactSelectionMemberInterests(int selectionId, int[] addCompanyInterests, int[] removeCompanyInterests, int[] addContactInterests, int[] removeContactInterests)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection to add or remove interests members from. |
Int32[] | addCompanyInterests | Array of int containing the id's of the interests to add to the company. |
Int32[] | removeCompanyInterests | Array of int containing the id's of the interests to remove from the company. |
Int32[] | addContactInterests | Array of int containing the id's of the interests to add to the contact. |
Int32[] | removeContactInterests | Array of int containing the id's of the interests to remove from the contact. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
AddSelectionMembers(Int32, Int32[])
Add selection members to a static selection of type others than contacts.
Declaration
public int AddSelectionMembers(int selectionId, int[] ids)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The selection id to add the members to. |
Int32[] | ids | Collection of ids to add to the selection. |
Returns
Type | Description |
---|---|
Int32 | Returns number of members added to the selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
AddSelectionMembersFromSearch(Int32, String)
Adds members from the selection using the search result.
Declaration
public int AddSelectionMembersFromSearch(int selectionId, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
Int32 | Number of members added. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CopyContactSelectionMembers(Int32, Int32)
Copy contact selection members from selection into an existing selection.
Declaration
public void CopyContactSelectionMembers(int fromSelectionId, int toSelectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | fromSelectionId | The id of the selection to copy members from. |
Int32 | toSelectionId | The id of the selection to copy members to. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CopySelectionMembers(Int32, Int32)
Copy selection members from selection into an existing selection.
Declaration
public void CopySelectionMembers(int fromSelectionId, int toSelectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | fromSelectionId | The id of the selection to copy members from. |
Int32 | toSelectionId | The id of the selection to copy members to. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateContactSelectionFromSelection(Int32, String, SelectionType, Boolean)
Creates a new selection based on selection members from an existing selection.
Declaration
public SelectionEntity CreateContactSelectionFromSelection(int selectionId, string name, SelectionType targetSelectionType, bool copyMembers)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Boolean | copyMembers | If true, the members from the original selection will be added to the newly created selection. |
Returns
Type | Description |
---|---|
SelectionEntity | Returns the newly created SelectionEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateContactSelectionFromShadowSelection(Int32, String)
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
public SelectionEntity CreateContactSelectionFromShadowSelection(int selectionId, string name)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection to copy members from. |
String | name | The name of the new selection. |
Returns
Type | Description |
---|---|
SelectionEntity | Returns the newly created SelectionEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateDefaultMailMergeSettings()
Loading default values into a new MailMergeSettings. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public MailMergeSettings CreateDefaultMailMergeSettings()
Returns
Type | Description |
---|---|
MailMergeSettings | New MailMergeSettings with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateDefaultMailMergeTask()
Loading default values into a new MailMergeTask. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public MailMergeTask CreateDefaultMailMergeTask()
Returns
Type | Description |
---|---|
MailMergeTask | New MailMergeTask with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateDefaultSelectionEntity()
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
public SelectionEntity CreateDefaultSelectionEntity()
Returns
Type | Description |
---|---|
SelectionEntity | New SelectionEntity with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateNewEntry(DuplicateEntry)
Creates a new selection based on external duplicate
Declaration
public int CreateNewEntry(DuplicateEntry duplicate)
Parameters
Type | Name | Description |
---|---|---|
DuplicateEntry | duplicate | The duplicate to create a new entry based upon |
Returns
Type | Description |
---|---|
Int32 | The database identity of the newly created entry |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateSelectionEntity(String)
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
public SelectionEntity CreateSelectionEntity(string targetTableName)
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 |
Returns
Type | Description |
---|---|
SelectionEntity | The new SelectionEntity, which has not yet been saved |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateSelectionFromSelection(Int32, String, SelectionType, Boolean)
Creates a new selection based on selection members from an existing selection.
Declaration
public SelectionEntity CreateSelectionFromSelection(int selectionId, string name, SelectionType targetSelectionType, bool copyMembers)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Boolean | copyMembers | If true, the members from the original selection will be added to the newly created selection. |
Returns
Type | Description |
---|---|
SelectionEntity | Returns the newly created SelectionEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateTemporaryContactSelection()
Creates a temporary selection.
Declaration
public SelectionEntity CreateTemporaryContactSelection()
Returns
Type | Description |
---|---|
SelectionEntity | Returns the newly created SelectionEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateTemporaryContactSelectionFromContactPersonIds(ContactPersonId[])
Creates a temporary selection with members from a collection of ContactPerson id's.
Declaration
public SelectionEntity CreateTemporaryContactSelectionFromContactPersonIds(ContactPersonId[] contactPersonIds)
Parameters
Type | Name | Description |
---|---|---|
ContactPersonId[] | contactPersonIds | A collection of ContactPersonId to copy into the temporary contact selection as members. |
Returns
Type | Description |
---|---|
SelectionEntity | Returns the newly created SelectionEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateTemporaryContactSelectionFromProjectMembers(Int32)
Creates a temporary selection with members from an existing project.
Declaration
public SelectionEntity CreateTemporaryContactSelectionFromProjectMembers(int projectId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The id of the project to add members from. |
Returns
Type | Description |
---|---|
SelectionEntity | Returns the newly created SelectionEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateTemporaryContactSelectionFromSelectionMemberIds(Int32, Int32[])
Creates a temporary selection with members from a collection of selectionmember id's.
Declaration
public SelectionEntity CreateTemporaryContactSelectionFromSelectionMemberIds(int selectionId, int[] selectionMemberIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The selectionId the selectionmembers is a part of. |
Int32[] | selectionMemberIds | A collection of int ids to copy into the temporary contact selection as members. |
Returns
Type | Description |
---|---|
SelectionEntity | Returns the newly created SelectionEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
CreateTemporarySelectionFromIds(Int32[], Int32)
Creates a temporary selection with members from a collection of entity id's.
Declaration
public SelectionEntity CreateTemporarySelectionFromIds(int[] ids, int targetTableNumber)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | 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. |
Int32 | targetTableNumber | The type of selection to create. |
Returns
Type | Description |
---|---|
SelectionEntity | Returns the newly created SelectionEntity. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
DeleteContacts(Int32)
Deletes all contacts from a selection. If a contact does not have delete rights, it will be skipped.
Declaration
public void DeleteContacts(int selectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | Id of the selection the delete operation will be performed. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
DeleteEntities(Int32)
Deletes all entities from a selection. If an entity does not have delete rights, it will be skipped.
Declaration
public void DeleteEntities(int selectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | Id of the selection the delete operation will be performed. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
DeletePersons(Int32)
Deletes all persons from a selection. If a person does not have delete rights, it will be skipped.
Declaration
public void DeletePersons(int selectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | Id of the selection the delete operation will be performed. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
DeleteSelectionEntity(Int32)
Deletes the SelectionEntity
Declaration
public void DeleteSelectionEntity(int selectionEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionEntityId | The identity of the SelectionEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
EditContactSelectionMemberDetails(Int32, SelectionMemberEditValues)
Edit company and contact details in a selection based on contents in selectionMemberEditValues.
Declaration
public void EditContactSelectionMemberDetails(int selectionId, SelectionMemberEditValues selectionMemberEditValues)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
ExportSelectionMembers(Int32, String, Boolean)
ExportSelectionMembers will generate a string that is the result of substituting the template variables with values from selectionmembers.
Declaration
public byte[] ExportSelectionMembers(int selectionId, string templateName, bool useContacts)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Boolean | useContacts | If the selection contains other members than contacts, setting this to true will export the contact archive of the selection. |
Returns
Type | Description |
---|---|
Byte[] | Returns a unicode byte array with the file to export to the user. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
ExportSelectionMembersWithOrderBy(Int32, String, Boolean, String)
ExportSelectionMembers will generate a string that is the result of substituting the template variables with values from selectionmembers.
Declaration
public byte[] ExportSelectionMembersWithOrderBy(int selectionId, string templateName, bool useContacts, string orderBy)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Boolean | 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> |
Returns
Type | Description |
---|---|
Byte[] | Returns a unicode byte array with the file to export to the user. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GenerateFollowUps(Int32, AppointmentEntity, Int32, Boolean, Boolean)
Generate follow-ups for members in the selection.
Declaration
public void GenerateFollowUps(int selectionId, AppointmentEntity appointmentEntity, int associateId, bool saveOnContactOwner, bool uniqueContact)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection to generate the follow-ups for. |
AppointmentEntity | appointmentEntity | The AppointmentEntity with information about the appointment. |
Int32 | 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. |
Boolean | saveOnContactOwner | If true, the appointments will be saved on contact owner (Our contact). This parameter will override associateId if true. |
Boolean | uniqueContact | If true, only one appointment will be created for each contact. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetDuplicateRules()
Retrieve all available duplicate rules for selection
Declaration
public DuplicateRule[] GetDuplicateRules()
Returns
Type | Description |
---|---|
DuplicateRule[] | All available duplicate rules |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetDuplicates(String)
Get duplicates(exact or similar in the database) based on the name
Declaration
public DuplicateEntry[] GetDuplicates(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name used for lookup |
Returns
Type | Description |
---|---|
DuplicateEntry[] | Any records matching the specified name |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetDynamicSelectionCriteria(Int32)
Get the criteria for this dynamic selection.
Declaration
public ArchiveRestrictionInfo[] GetDynamicSelectionCriteria(int selectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection to add members |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Criteria defining the selection result. NULL if selection does not exist, or if this is not a dynamic selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetDynamicSelectionCriteriaGroups(Int32)
Get the criteria for this dynamic selection. This call supports multiple criteria groups.
Declaration
public ArchiveRestrictionGroup[] GetDynamicSelectionCriteriaGroups(int selectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection to add members |
Returns
Type | Description |
---|---|
ArchiveRestrictionGroup[] | Criteria groups defining the selection result. NULL if selection does not exist, or if this is not a dynamic selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetParentCombinedSelections(Int32)
Get a list of all selection ids where the given selection is used to create a combined selection.
Declaration
public int[] GetParentCombinedSelections(int selectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The selectionId to query for. |
Returns
Type | Description |
---|---|
Int32[] | Array of selectionIds. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetRecipientStatistics(Int32)
Returns a RecipientStatistics object with a count of addresses, emailaddresses and emailaddresses.
Declaration
public RecipientStatistics GetRecipientStatistics(int selectionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection to get the statistics for. |
Returns
Type | Description |
---|---|
RecipientStatistics | Returns a RecipientStatistics object. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetRecipientStatisticsFromContactPersonIds(ContactPersonId[])
Returns a RecipientStatistics object with a count of addresses, emailaddresses and emailaddresses based on contact and persons in a collection of ContactPersonId.
Declaration
public RecipientStatistics GetRecipientStatisticsFromContactPersonIds(ContactPersonId[] contactPersonIds)
Parameters
Type | Name | Description |
---|---|---|
ContactPersonId[] | contactPersonIds | A collection of ContactPersonId to get the statistics for. |
Returns
Type | Description |
---|---|
RecipientStatistics | Returns a RecipientStatistics object. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetRecipientStatisticsFromProjectMembers(Int32)
Returns a RecipientStatistics object with a count of addresses, emailaddresses and emailaddresses based on members in a project.
Declaration
public RecipientStatistics GetRecipientStatisticsFromProjectMembers(int projectId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | projectId | The id of the project to get the member statistics for. |
Returns
Type | Description |
---|---|
RecipientStatistics | Returns a RecipientStatistics object. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetSelectionEntity(Int32)
Gets a SelectionEntity object.
Declaration
public SelectionEntity GetSelectionEntity(int selectionEntityId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionEntityId | The identifier of the SelectionEntity object |
Returns
Type | Description |
---|---|
SelectionEntity | SelectionEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetSelectionForFind(String, Int32)
Obtain a selection for the given entity, for the current user, of type WorkingSetForFind. Optionally populate criteria from the TypicalSearches system
Declaration
public SelectionForFind GetSelectionForFind(string entityName, int typicalSearchId)
Parameters
Type | Name | Description |
---|---|---|
String | entityName | The name of the entity to make a selection for; examples 'sale', 'project', 'y_equipment' |
Int32 | typicalSearchId | If 0, keep existing criteria; if -1, reset to entity default; > 0 get criteria from given TypicalSearch |
Returns
Type | Description |
---|---|
SelectionForFind | Target selection id and provider name |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetSelectionMembersArchiveRows(Int32, String)
Get the list of members in this selection. The type of members depends on the target table of the selection.
Declaration
public ArchiveListItem[] GetSelectionMembersArchiveRows(int selectionId, string select)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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' |
Returns
Type | Description |
---|---|
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. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetSelectionShadowMembersArchiveRows(Int32, String)
Get the list of members in this selection's shadow (i.e. the list of contacts + persons referenced in the main selection).
Declaration
public ArchiveListItem[] GetSelectionShadowMembersArchiveRows(int selectionId, string select)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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' |
Returns
Type | Description |
---|---|
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. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
GetSelectionSummaries(Int32[])
Get an array of summaryitem for the given selections
Declaration
public SelectionSummaryItem[] GetSelectionSummaries(int[] selectionIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | selectionIds | The selections to fetch summaries for |
Returns
Type | Description |
---|---|
SelectionSummaryItem[] | Summary items for the given id's, in no particular order |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
RemoveContactSelectionMembers(Int32, ContactPersonId[])
Removes members from the selection as specified in the collection of ContactPersonId.
Declaration
public void RemoveContactSelectionMembers(int selectionId, ContactPersonId[] contactPersonIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection where to members will be removed. |
ContactPersonId[] | contactPersonIds | A collection of ContactPersonId to remove from the static selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
RemoveContactSelectionMembersFromIds(Int32, Int32[])
Removes members from the selection using a collection a selectionmember id's. Members can only be removed from single selection.
Declaration
public void RemoveContactSelectionMembersFromIds(int selectionId, int[] selectionMembersIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection where to members will be removed. |
Int32[] | selectionMembersIds | An array of selectionmember id's to remove from the selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
RemoveContactSelectionMembersFromSearch(Int32, String)
Removes members from the selection using the search result.
Declaration
public int RemoveContactSelectionMembersFromSearch(int selectionId, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Returns
Type | Description |
---|---|
Int32 | Number of members removed |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
RemoveSelectionMembers(Int32, Int32[])
Removes members from the selection as specified in the collection of entity ids. The ids are selection member ids (selection member primary key)
Declaration
public void RemoveSelectionMembers(int selectionId, int[] selectionMemberIds)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection where to members will be removed. |
Int32[] | selectionMemberIds | Selection member primary keys |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
RemoveSelectionMembersById(Int32, Int32[])
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
public void RemoveSelectionMembersById(int selectionId, int[] ids)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection where to members will be removed. |
Int32[] | 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. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
RemoveSelectionMembersFromSearch(Int32, String)
Removes members from the selection using the search result.
Declaration
public int RemoveSelectionMembersFromSearch(int selectionId, string storageKey)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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. |
Returns
Type | Description |
---|---|
Int32 | Number of members removed |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
SaveSelectionEntity(SelectionEntity)
Updates the existing SelectionEntity or creates a new SelectionEntity if the id parameter is empty
Declaration
public SelectionEntity SaveSelectionEntity(SelectionEntity selectionEntity)
Parameters
Type | Name | Description |
---|---|---|
SelectionEntity | selectionEntity | The SelectionEntity that is saved. |
Returns
Type | Description |
---|---|
SelectionEntity | New or updated SelectionEntity |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
SetDuplicateRulesStatus(DuplicateRule[])
Set which duplicate rules should be active or not
Declaration
public void SetDuplicateRulesStatus(DuplicateRule[] rules)
Parameters
Type | Name | Description |
---|---|---|
DuplicateRule[] | rules | Duplicate rules to update active status for |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
SetDynamicSelectionCriteria(Int32, ArchiveRestrictionInfo[])
Update the criteria for this dynamic selection. Replaces existing criteria with the new values.
Declaration
public ArchiveRestrictionInfo[] SetDynamicSelectionCriteria(int selectionId, ArchiveRestrictionInfo[] criteria)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection to add members |
ArchiveRestrictionInfo[] | criteria | Criteria defining the selection result. |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Criteria defining the selection result. NULL if this is not a dynamic selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
SetDynamicSelectionCriteria2(Int32, String)
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
public ArchiveRestrictionInfo[] SetDynamicSelectionCriteria2(int selectionId, string filter)
Parameters
Type | Name | Description |
---|---|---|
Int32 | selectionId | The id of the selection to add members |
String | filter | Criteria defining the selection result in OData filter form: |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Criteria defining the selection result. NULL if this is not a dynamic selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
SetDynamicSelectionCriteria3(Int32, ArchiveRestrictionInfo[], String)
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
public ArchiveRestrictionInfo[] SetDynamicSelectionCriteria3(int selectionId, ArchiveRestrictionInfo[] criteria, string filter)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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: |
Returns
Type | Description |
---|---|
ArchiveRestrictionInfo[] | Criteria defining the selection result. NULL if this is not a dynamic selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
SetDynamicSelectionCriteriaGroups(Int32, ArchiveRestrictionGroup[])
Update the criteria for this dynamic selection. Replaces existing criteria with the new values. This call supports multiple criteria groups.
Declaration
public ArchiveRestrictionGroup[] SetDynamicSelectionCriteriaGroups(int selectionId, ArchiveRestrictionGroup[] criteria)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
Returns
Type | Description |
---|---|
ArchiveRestrictionGroup[] | Criteria groups defining the selection result. NULL if this is not a dynamic selection. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
StartMailMerge(MailMergeSettings)
Start a mailmerge operation with specified settings.
Declaration
public void StartMailMerge(MailMergeSettings settings)
Parameters
Type | Name | Description |
---|---|---|
MailMergeSettings | settings | All settings needed to perform the mailmerge operation. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}
UpdateTypicalSearch(TypicalSearches)
Update (import) TypicalSearch information in the database
Declaration
public string UpdateTypicalSearch(TypicalSearches searches)
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 |
Returns
Type | Description |
---|---|
String | Message that can be shown to the user, summarizing what has been done, if anything. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SelectionAgent agent = new SelectionAgent())
{
// call methods on agent here...
}
}