Show / Hide Table of Contents

Interface ITargetsAgent

Interface for the Targets Agent Agent lets you configure targets, and retrieve targets

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Targets Agent", "Interface for the Targets Agent. Agent lets you configure targets, and retrieve targets")]
public interface ITargetsAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (TargetsAgent agent = new TargetsAgent())
   {
      // call methods on agent here...
   }
}

Methods

CreateDefaultTargetAssignmentAsync(CancellationToken)

Loading default values into a new TargetAssignment. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<TargetAssignment> CreateDefaultTargetAssignmentAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment>

New TargetAssignment with default values

CreateDefaultTargetAssignmentForCompanyAsync(CancellationToken)

Returns a default target assignment for the owner company.

Declaration
Task<TargetAssignment> CreateDefaultTargetAssignmentForCompanyAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment>

Default target assignment for the owner company.

CreateDefaultTargetAssignmentForCompanyWithDimensionAsync(int, CancellationToken)

Returns a default target assignment for the owner company, for the specified dimension.

Declaration
Task<TargetAssignment[]> CreateDefaultTargetAssignmentForCompanyWithDimensionAsync(int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetDimensionId

The dimension id to use.

CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment[]>

Default target assignments for the owner company.

CreateDefaultTargetAssignmentForCompanyWithYearAndDimensionAsync(int, int, CancellationToken)

Returns a default target assignment for the owner company, for the specified year and dimension.

Declaration
Task<TargetAssignment[]> CreateDefaultTargetAssignmentForCompanyWithYearAndDimensionAsync(int year, int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int year

The year from which to retrieve dimension data.

int targetDimensionId

The dimension id to use.

CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment[]>

Default target assignments for the owner company.

CreateDefaultTargetAssignmentForUserGroupAsync(int, CancellationToken)

Returns a default target assignment for the specified usergroup.

Declaration
Task<TargetAssignment[]> CreateDefaultTargetAssignmentForUserGroupAsync(int userGroupId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int userGroupId

The id of the UserGroup

CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment[]>

Default target assignment for the specified usergroup.

CreateDefaultTargetAssignmentForUserGroupWithDimensionAsync(int, int, CancellationToken)

Returns a default target assignment for the specified usergroup, for the specified dimension.

Declaration
Task<TargetAssignment[]> CreateDefaultTargetAssignmentForUserGroupWithDimensionAsync(int userGroupId, int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int userGroupId

The id of the UserGroup

int targetDimensionId

The dimension id to use.

CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment[]>

Default target assignment for the specified usergroup.

CreateDefaultTargetAssignmentForUserGroupWithYearAndDimensionAsync(int, int, int, CancellationToken)

Returns a default target assignment for the specified usergroup, for the specified year and dimension.

Declaration
Task<TargetAssignment[]> CreateDefaultTargetAssignmentForUserGroupWithYearAndDimensionAsync(int userGroupId, int year, int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int userGroupId

The id of the UserGroup

int year

The year from which to retrieve dimension data.

int targetDimensionId

The dimension id to use.

CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment[]>

Default target assignment for the specified usergroup.

CreateDefaultTargetDimensionAsync(CancellationToken)

Loading default values into a new TargetDimension. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<TargetDimension> CreateDefaultTargetDimensionAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TargetDimension>

New TargetDimension with default values

CreateDefaultTargetGroupAsync(CancellationToken)

Loading default values into a new TargetGroup. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<TargetGroup> CreateDefaultTargetGroupAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TargetGroup>

New TargetGroup with default values

CreateDefaultTargetRevisionAsync(CancellationToken)

Loading default values into a new TargetRevision. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<TargetRevision> CreateDefaultTargetRevisionAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TargetRevision>

New TargetRevision with default values

CreateDefaultTargetRevisionHistoryAsync(CancellationToken)

Loading default values into a new TargetRevisionHistory. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance

Declaration
Task<TargetRevisionHistory> CreateDefaultTargetRevisionHistoryAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TargetRevisionHistory>

New TargetRevisionHistory with default values

DeleteTargetDimensionAsync(int, CancellationToken)

Deletes the TargetDimension

Declaration
Task DeleteTargetDimensionAsync(int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetDimensionId

The identity of the TargetDimension

CancellationToken cancellationToken
Returns
Type Description
Task

DeleteTargetGroupAsync(int, CancellationToken)

Deletes the TargetGroup

Declaration
Task DeleteTargetGroupAsync(int targetGroupId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetGroupId

The identity of the TargetGroup

CancellationToken cancellationToken
Returns
Type Description
Task

ExportTargetGroupToExcelAsync(int, CancellationToken)

Renders the given targetgroup to excel, and returns the path to the temporary file.

Declaration
Task<ExportArchiveResult> ExportTargetGroupToExcelAsync(int targetGroupId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetGroupId

The id of the targetgroup to be rendered to excel.

CancellationToken cancellationToken
Returns
Type Description
Task<ExportArchiveResult>

GetTargetAssignmentForYearAndDimensionAsync(int, TargetEntityType, TargetLevel, int, int, CancellationToken)

Returns the target assignment for the specified year, entity type and dimension.

Declaration
Task<TargetAssignment> GetTargetAssignmentForYearAndDimensionAsync(int targetYear, TargetEntityType entityType, TargetLevel targetLevel, int id, int dimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetYear

Targeted year

TargetEntityType entityType

Targeted entity type

TargetLevel targetLevel

The level of target the id is referring to.

int id

Contact, UserGroup or Associate id.

int dimensionId

Id of dimension.

CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment>

Target assignment for a specified entity for year and entity type. Null if not found.

GetTargetAssignmentForYearAsync(int, TargetEntityType, TargetLevel, int, CancellationToken)

Returns the target assignment for the specified year and entity type.

Declaration
Task<TargetAssignment> GetTargetAssignmentForYearAsync(int targetYear, TargetEntityType entityType, TargetLevel targetLevel, int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetYear

Targeted year

TargetEntityType entityType

Targeted entity type

TargetLevel targetLevel

The level of target the id is referring to.

int id

Contact, UserGroup or Associate id.

CancellationToken cancellationToken
Returns
Type Description
Task<TargetAssignment>

Target assignment for a specified entity for year and entity type. Null if not found.

GetTargetDimensionAsync(int, CancellationToken)

Gets a TargetDimension object.

Declaration
Task<TargetDimension> GetTargetDimensionAsync(int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetDimensionId

The identifier of the TargetDimension object

CancellationToken cancellationToken
Returns
Type Description
Task<TargetDimension>

TargetDimension

GetTargetDimensionsForEntityTypeAsync(TargetEntityType, CancellationToken)

Returns the target dimensions for the given entity type.

Declaration
Task<TargetDimension[]> GetTargetDimensionsForEntityTypeAsync(TargetEntityType entityType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TargetEntityType entityType

Targeted entity type

CancellationToken cancellationToken
Returns
Type Description
Task<TargetDimension[]>

Target dimensions for year and entity type.

GetTargetGroupAsync(int, CancellationToken)

Gets a TargetGroup object.

Declaration
Task<TargetGroup> GetTargetGroupAsync(int targetGroupId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetGroupId

The identifier of the TargetGroup object

CancellationToken cancellationToken
Returns
Type Description
Task<TargetGroup>

TargetGroup

GetTargetGroupForYearAndDimensionAsync(int, int, CancellationToken)

Returns the target group for the specified year and dimension.

Declaration
Task<TargetGroup> GetTargetGroupForYearAndDimensionAsync(int targetYear, int dimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetYear

Targeted year

int dimensionId

Targeted dimension Id

CancellationToken cancellationToken
Returns
Type Description
Task<TargetGroup>

Target Group for year and dimension.

GetTargetGroupForYearAsync(int, TargetEntityType, CancellationToken)

Returns the target group for the specified year and entity type.

Declaration
Task<TargetGroup> GetTargetGroupForYearAsync(int targetYear, TargetEntityType entityType, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetYear

Targeted year

TargetEntityType entityType

Targeted entity type

CancellationToken cancellationToken
Returns
Type Description
Task<TargetGroup>

Target Group for year and entity type.

GetTargetGroupIdsAsync(int, CancellationToken)

Returns ids of the target groups that use this dimension.

Declaration
Task<int[]> GetTargetGroupIdsAsync(int targetDimensionId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetDimensionId

The target dimension id

CancellationToken cancellationToken
Returns
Type Description
Task<int[]>

Target group ids.

GetTargetRevisionHistoryAsync(int, CancellationToken)

Returns the revision history for a given TargetAssignmentInfo in chronological order.

Declaration
Task<TargetRevisionHistory> GetTargetRevisionHistoryAsync(int targetAssignmentInfoId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int targetAssignmentInfoId

Target assignment info id

CancellationToken cancellationToken
Returns
Type Description
Task<TargetRevisionHistory>

Target revision history for the given TargetAssignmentInfo

SaveTargetDimensionAsync(TargetDimension, CancellationToken)

Updates the existing TargetDimension or creates a new TargetDimension if the id parameter is empty

Declaration
Task<TargetDimension> SaveTargetDimensionAsync(TargetDimension targetDimension, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TargetDimension targetDimension

The TargetDimension that is saved.

CancellationToken cancellationToken
Returns
Type Description
Task<TargetDimension>

New or updated TargetDimension

SaveTargetGroupAsync(TargetGroup, CancellationToken)

Updates the existing TargetGroup or creates a new TargetGroup if the id parameter is empty

Declaration
Task<TargetGroup> SaveTargetGroupAsync(TargetGroup targetGroup, CancellationToken cancellationToken = default)
Parameters
Type Name Description
TargetGroup targetGroup

The TargetGroup that is saved.

CancellationToken cancellationToken
Returns
Type Description
Task<TargetGroup>

New or updated TargetGroup

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top