Skip to main content
IArchiveAgent is the common interface for the ArchiveAgent.

Methods

Following is a list of methods provided by the agent that helps us to manipulate the content of the Archives. Activity filters are restrictions that help place restrictions on the output returned.

Example

The example below shows us how we may make use of the IArchiveAgent interface and its methods.
CS

GetArchiveListByColumns()

The method call itself is a simple statement. The difficult part is to create the parameters that should be passed to it.
CS
The GetArchiveListByColumns method requires 7 parameters.
  • archiveProviderName - the name of the provider that will be used to retrieve the required information. In the example, the person provider will be created using the ArchiveProviderFactory from a plugin.
CS
  • archiveColumns - the list of columns that needs to be returned by the method. The list is an array of string which can be declared as follows.
CS
The names of the columns differ from the names that have been given in the database. Use the IArchiveProver to retrieve the columns that are available under a particular column.
  • archiveSrtOrd - the sort order in which the returned data should be sorted. Can be null, which indicates no particular order.
CS
ArchiveOrderByInfo is defined in SuperOffice.CRM.ArchiveLists.
  • archiveRest - an array of ArchiveRestrictionInfo that contains the restriction on which the retrieved archive list is based on.
CS
The archives will generally throw an exception if no restrictions are set. If you don’t want any restriction, pass in an empty array, but remember that you may end up fetching the first page of millions of rows.
  • desiredEntities - tells the method to include only the details of all the entities given in the array. Can be null, which indicates that all entities will be included.
CS
  • page and pageSize - page (number) 0 is the first page; pageSize is the number of rows that should be contained in a page
CS

Result

Once all parameters have been created we may use them with the GetArchiveListByColumns method which returns an array of ArchiveListItem.
CS
What is done by the above code segments is that for each column type which is a Key/Value pair it writes the key of it. Since this segment is used inside the If-statement the code piece will be executed only when the loop is run for the first time. The intended purpose of the above is to display the column headings. The archiveRow.ColumnData is a dictionary of column data items. Each column data item contains a display value, a tooltip hint, a link hint, and an ordinary value. The display values are encoded by the CultureDataFormatter and can be decoded/localized by that class. All other values are optional. Tooltip hints can be passed into the TooltipProvider (Tooltip service) to be translated into an actual tooltip. The second for-loop is the one that actually retrieves the data from the database.
CS
Here we make use of the ArchiveRow.ColumnData’s DisplayValue property, which is the visible display value for an archive cell. This is always a String and any other data type should be converted to it according to the invariant culture.

Output