Interface IBulkUpdateAgent
Interface for the BulkUpdate Agent Agent used for bulk update methods
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("BulkUpdate Agent", "Interface for the BulkUpdate Agent. Agent used for bulk update methods")]
public interface IBulkUpdateAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (BulkUpdateAgent agent = new BulkUpdateAgent())
{
// call methods on agent here...
}
}
Methods
ExecuteByEntityIdsAsync(FieldValueInfo[], string, string, string, CancellationToken)
Do the batchupdate on selected
Declaration
Task<int> ExecuteByEntityIdsAsync(FieldValueInfo[] fieldValueInfos, string tableName, string context, string ids, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
FieldValueInfo[] | fieldValueInfos | The name of the wanted tablename |
string | tableName | The name of the table to bulk update |
string | context | Where is the function called from |
string | ids | Comma separated string of the ids of the entities to update |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Return batchtaskinfoid |
ExecuteBySelectionIdAsync(FieldValueInfo[], string, string, int, bool, CancellationToken)
Do the batchupdate on this selection
Declaration
Task<int> ExecuteBySelectionIdAsync(FieldValueInfo[] fieldValueInfos, string tableName, string context, int selectionId, bool isShadow, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
FieldValueInfo[] | fieldValueInfos | The name of the wanted tablename |
string | tableName | The name of the table to bulk update |
string | context | Where is the function called for |
int | selectionId | The id of the selection |
bool | isShadow | Use the shadow selection |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<int> | Return batchtaskinfoid |
GetAvailableFieldsAsync(string, CancellationToken)
Get all available fields for a given tablename/entity
Declaration
Task<FieldValueInfo[]> GetAvailableFieldsAsync(string tablename, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tablename | The name of the wanted tablename |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<FieldValueInfo[]> | Returns array of the available fields for the given entity |
GetJobResultAsJsonFromBinaryObjectIdAsync(string, int, CancellationToken)
Get result of the batchupdate job
Declaration
Task<string> GetJobResultAsJsonFromBinaryObjectIdAsync(string tableName, int binaryObjectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | The name of the table that was updated to show the log from |
int | binaryObjectId | Which binaryobject id has stored the job result |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string> | Result of job as json |
GetJobResultsFromStorageAsJsonAsync(CancellationToken)
Get result of the batchupdate job
Declaration
Task<string[]> GetJobResultsFromStorageAsJsonAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<string[]> | Result of job as json |
GetStoredFieldsAsync(string, string, CancellationToken)
Get all stored fields for a given tablename/entity and context
Declaration
Task<FieldValueInfo[]> GetStoredFieldsAsync(string tablename, string context, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tablename | The name of the wanted tablename |
string | context | Where is the function called for |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<FieldValueInfo[]> | Returns array of the stored or default fields for the given entity |
RemoveStoredFieldsAndGetDefaultFieldsAsync(string, string, CancellationToken)
Remove the stored settings of the bulk update for this table from this context, to get the default settings instead
Declaration
Task<FieldValueInfo[]> RemoveStoredFieldsAndGetDefaultFieldsAsync(string tableName, string context, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | The name of the table to remove stored settings from |
string | context | Where is the function called from that we will remove the settings from |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<FieldValueInfo[]> | Returns array of the available fields for the given tablename |
RemoveStoredFieldsAsync(string, string, CancellationToken)
Remove the stored settings of the bulk update for this table from this context
Declaration
Task<bool> RemoveStoredFieldsAsync(string tableName, string context, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | tableName | The name of the table to remove stored settings from |
string | context | Where is the function called from that we will remove the settings from |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> |