Interface IFavouriteAgent
Interface for the Favourite Agent Agent used for retrieveing and setting favourites
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Favourite Agent", "Interface for the Favourite Agent. Agent used for retrieveing and setting favourites")]
public interface IFavouriteAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
Methods
AddFavourite(String, Int32, Int32, String)
Add a record in a table as a favourite for an associate
Declaration
void AddFavourite(string tableName, int recordId, int associateId, string extraInfo)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name, transformed to and from numeric table id by the service layer. |
Int32 | recordId | Id of a record in your specified table (tableName) |
Int32 | associateId | Id of a current user |
String | extraInfo | Any extra information |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
AddFavourites(String, Int32[], Int32, String)
Add a list of record ids as favourites for an associate
Declaration
void AddFavourites(string tableName, int[] recordIds, int associateId, string extraInfo)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name, transformed to and from numeric table id by the service layer. |
Int32[] | recordIds | Ids of records in your specified table (tableName). Corresponding rows will be added as Favourites. |
Int32 | associateId | Id of a current user |
String | extraInfo | Any extra information |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
AddTicketsToFavouritesByProvider(String, ArchiveRestrictionInfo[], Int32, String)
Add a list of tickets as favourites that are given by the ticket provider.
Declaration
void AddTicketsToFavouritesByProvider(string providerName, ArchiveRestrictionInfo[] restrictions, int associateId, string extraInfo)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Name of a ticket provider |
ArchiveRestrictionInfo[] | restrictions | Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction. |
Int32 | associateId | Id of a current user |
String | extraInfo | Any extra information |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
GetFavourites(String, Int32)
Get all favourites for a table and associate
Declaration
Favourite[] GetFavourites(string tableName, int associateId)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name, transformed to and from numeric table id by the service layer. |
Int32 | associateId | Id of a current user |
Returns
Type | Description |
---|---|
Favourite[] | Requested favourites for a table and associate |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
IsFavourite(String, Int32, Int32)
Checks if a record in a table is a favourite for an associate
Declaration
bool IsFavourite(string tableName, int recordId, int associateId)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name, transformed to and from numeric table id by the service layer. |
Int32 | recordId | Id of a record in your specified table (tableName) |
Int32 | associateId | Id of a current user |
Returns
Type | Description |
---|---|
Boolean | Is Favourite? |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
RemoveAllFavourites(String, Int32)
Remove all favourites for a table and associate
Declaration
void RemoveAllFavourites(string tableName, int associateId)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name, transformed to and from numeric table id by the service layer. |
Int32 | associateId | Id of a current user |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
RemoveFavourite(String, Int32, Int32)
Remove favourite for a table, record id and associate
Declaration
void RemoveFavourite(string tableName, int recordId, int associateId)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name, transformed to and from numeric table id by the service layer. |
Int32 | recordId | Id of a record in your specified table (tableName) |
Int32 | associateId | Id of a current user |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
RemoveFavourites(String, Int32[], Int32)
Remove a list of record ids from favourites for an associate
Declaration
void RemoveFavourites(string tableName, int[] recordIds, int associateId)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name, transformed to and from numeric table id by the service layer. |
Int32[] | recordIds | Ids of records in your specified table (tableName). Corresponding rows will be removed from Favourites. |
Int32 | associateId | Id of a current user |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
RemoveFavouritesById(Int32[])
Remove favourite using favourite id
Declaration
void RemoveFavouritesById(int[] favouriteIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | favouriteIds | Ids of favourite rows to delete |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
RemoveTicketsFromFavouritesByProvider(String, ArchiveRestrictionInfo[], Int32)
Remove a list of tickets from favourites that are given by the ticket provider.
Declaration
void RemoveTicketsFromFavouritesByProvider(string providerName, ArchiveRestrictionInfo[] restrictions, int associateId)
Parameters
Type | Name | Description |
---|---|---|
String | providerName | Name of a ticket provider |
ArchiveRestrictionInfo[] | restrictions | Query restrictions to be added to provider. Fixed providers, such as LastTicketsProvider, FavouriteTicketsProvider etc. already have mandatory restrictions setup - in such case extra restrictions will be combined, however for general use case for fixed providers you can pass an empty array and provider will return default results. For selection providers generally you should pass selectionId as a restriction. |
Int32 | associateId | Id of a current user |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}
ToggleFavourite(String, Int32, Int32, String)
Toggle a record in a table as a favourite for an associate
Declaration
bool ToggleFavourite(string tableName, int recordId, int associateId, string extraInfo)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name, transformed to and from numeric table id by the service layer. |
Int32 | recordId | Id of a record in your specified table (tableName) |
Int32 | associateId | Id of a current user |
String | extraInfo | Any extra information |
Returns
Type | Description |
---|---|
Boolean | Return the new value, true if added, false if removed |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (FavouriteAgent agent = new FavouriteAgent())
{
// call methods on agent here...
}
}