Class TargetsAgent
Facade for the Targets Agent Agent lets you configure targets, and retrieve targets
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class TargetsAgent : AgentBase<ITargetsAgent>, IDisposable, 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...
}
}
Constructors
TargetsAgent()
Facade for the Targets Agent Agent lets you configure targets, and retrieve targets
Declaration
public TargetsAgent()
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
CreateDefaultTargetAssignment()
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
public TargetAssignment CreateDefaultTargetAssignment()
Returns
Type | Description |
---|---|
TargetAssignment | New TargetAssignment with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetAssignmentForCompany()
Returns a default target assignment for the owner company.
Declaration
public TargetAssignment CreateDefaultTargetAssignmentForCompany()
Returns
Type | Description |
---|---|
TargetAssignment | Default target assignment for the owner company. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetAssignmentForCompanyWithDimension(Int32)
Returns a default target assignment for the owner company, for the specified dimension.
Declaration
public TargetAssignment[] CreateDefaultTargetAssignmentForCompanyWithDimension(int targetDimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetDimensionId | The dimension id to use. |
Returns
Type | Description |
---|---|
TargetAssignment[] | Default target assignments for the owner company. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetAssignmentForCompanyWithYearAndDimension(Int32, Int32)
Returns a default target assignment for the owner company, for the specified year and dimension.
Declaration
public TargetAssignment[] CreateDefaultTargetAssignmentForCompanyWithYearAndDimension(int year, int targetDimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | year | The year from which to retrieve dimension data. |
Int32 | targetDimensionId | The dimension id to use. |
Returns
Type | Description |
---|---|
TargetAssignment[] | Default target assignments for the owner company. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetAssignmentForUserGroup(Int32)
Returns a default target assignment for the specified usergroup.
Declaration
public TargetAssignment[] CreateDefaultTargetAssignmentForUserGroup(int userGroupId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userGroupId | The id of the UserGroup |
Returns
Type | Description |
---|---|
TargetAssignment[] | Default target assignment for the specified usergroup. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetAssignmentForUserGroupWithDimension(Int32, Int32)
Returns a default target assignment for the specified usergroup, for the specified dimension.
Declaration
public TargetAssignment[] CreateDefaultTargetAssignmentForUserGroupWithDimension(int userGroupId, int targetDimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userGroupId | The id of the UserGroup |
Int32 | targetDimensionId | The dimension id to use. |
Returns
Type | Description |
---|---|
TargetAssignment[] | Default target assignment for the specified usergroup. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetAssignmentForUserGroupWithYearAndDimension(Int32, Int32, Int32)
Returns a default target assignment for the specified usergroup, for the specified year and dimension.
Declaration
public TargetAssignment[] CreateDefaultTargetAssignmentForUserGroupWithYearAndDimension(int userGroupId, int year, int targetDimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | userGroupId | The id of the UserGroup |
Int32 | year | The year from which to retrieve dimension data. |
Int32 | targetDimensionId | The dimension id to use. |
Returns
Type | Description |
---|---|
TargetAssignment[] | Default target assignment for the specified usergroup. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetDimension()
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
public TargetDimension CreateDefaultTargetDimension()
Returns
Type | Description |
---|---|
TargetDimension | New TargetDimension with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetGroup()
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
public TargetGroup CreateDefaultTargetGroup()
Returns
Type | Description |
---|---|
TargetGroup | New TargetGroup with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetRevision()
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
public TargetRevision CreateDefaultTargetRevision()
Returns
Type | Description |
---|---|
TargetRevision | New TargetRevision with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
CreateDefaultTargetRevisionHistory()
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
public TargetRevisionHistory CreateDefaultTargetRevisionHistory()
Returns
Type | Description |
---|---|
TargetRevisionHistory | New TargetRevisionHistory with default values |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
DeleteTargetDimension(Int32)
Deletes the TargetDimension
Declaration
public void DeleteTargetDimension(int targetDimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetDimensionId | The identity of the TargetDimension |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
DeleteTargetGroup(Int32)
Deletes the TargetGroup
Declaration
public void DeleteTargetGroup(int targetGroupId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetGroupId | The identity of the TargetGroup |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
ExportTargetGroupToExcel(Int32)
Renders the given targetgroup to excel, and returns the path to the temporary file.
Declaration
public ExportArchiveResult ExportTargetGroupToExcel(int targetGroupId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetGroupId | The id of the targetgroup to be rendered to excel. |
Returns
Type | Description |
---|---|
ExportArchiveResult |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetAssignmentForYear(Int32, TargetEntityType, TargetLevel, Int32)
Returns the target assignment for the specified year and entity type.
Declaration
public TargetAssignment GetTargetAssignmentForYear(int targetYear, TargetEntityType entityType, TargetLevel targetLevel, int id)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetYear | Targeted year |
TargetEntityType | entityType | Targeted entity type |
TargetLevel | targetLevel | The level of target the id is referring to. |
Int32 | id | Contact, UserGroup or Associate id. |
Returns
Type | Description |
---|---|
TargetAssignment | Target assignment for a specified entity for year and entity type. Null if not found. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetAssignmentForYearAndDimension(Int32, TargetEntityType, TargetLevel, Int32, Int32)
Returns the target assignment for the specified year, entity type and dimension.
Declaration
public TargetAssignment GetTargetAssignmentForYearAndDimension(int targetYear, TargetEntityType entityType, TargetLevel targetLevel, int id, int dimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetYear | Targeted year |
TargetEntityType | entityType | Targeted entity type |
TargetLevel | targetLevel | The level of target the id is referring to. |
Int32 | id | Contact, UserGroup or Associate id. |
Int32 | dimensionId | Id of dimension. |
Returns
Type | Description |
---|---|
TargetAssignment | Target assignment for a specified entity for year and entity type. Null if not found. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetDimension(Int32)
Gets a TargetDimension object.
Declaration
public TargetDimension GetTargetDimension(int targetDimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetDimensionId | The identifier of the TargetDimension object |
Returns
Type | Description |
---|---|
TargetDimension | TargetDimension |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetDimensionsForEntityType(TargetEntityType)
Returns the target dimensions for the given entity type.
Declaration
public TargetDimension[] GetTargetDimensionsForEntityType(TargetEntityType entityType)
Parameters
Type | Name | Description |
---|---|---|
TargetEntityType | entityType | Targeted entity type |
Returns
Type | Description |
---|---|
TargetDimension[] | Target dimensions for year and entity type. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetGroup(Int32)
Gets a TargetGroup object.
Declaration
public TargetGroup GetTargetGroup(int targetGroupId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetGroupId | The identifier of the TargetGroup object |
Returns
Type | Description |
---|---|
TargetGroup | TargetGroup |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetGroupForYear(Int32, TargetEntityType)
Returns the target group for the specified year and entity type.
Declaration
public TargetGroup GetTargetGroupForYear(int targetYear, TargetEntityType entityType)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetYear | Targeted year |
TargetEntityType | entityType | Targeted entity type |
Returns
Type | Description |
---|---|
TargetGroup | Target Group for year and entity type. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetGroupForYearAndDimension(Int32, Int32)
Returns the target group for the specified year and dimension.
Declaration
public TargetGroup GetTargetGroupForYearAndDimension(int targetYear, int dimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetYear | Targeted year |
Int32 | dimensionId | Targeted dimension Id |
Returns
Type | Description |
---|---|
TargetGroup | Target Group for year and dimension. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetGroupIds(Int32)
Returns ids of the target groups that use this dimension.
Declaration
public int[] GetTargetGroupIds(int targetDimensionId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetDimensionId | The target dimension id |
Returns
Type | Description |
---|---|
Int32[] | Target group ids. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
GetTargetRevisionHistory(Int32)
Returns the revision history for a given TargetAssignmentInfo in chronological order.
Declaration
public TargetRevisionHistory GetTargetRevisionHistory(int targetAssignmentInfoId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | targetAssignmentInfoId | Target assignment info id |
Returns
Type | Description |
---|---|
TargetRevisionHistory | Target revision history for the given TargetAssignmentInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
SaveTargetDimension(TargetDimension)
Updates the existing TargetDimension or creates a new TargetDimension if the id parameter is empty
Declaration
public TargetDimension SaveTargetDimension(TargetDimension targetDimension)
Parameters
Type | Name | Description |
---|---|---|
TargetDimension | targetDimension | The TargetDimension that is saved. |
Returns
Type | Description |
---|---|
TargetDimension | New or updated TargetDimension |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}
SaveTargetGroup(TargetGroup)
Updates the existing TargetGroup or creates a new TargetGroup if the id parameter is empty
Declaration
public TargetGroup SaveTargetGroup(TargetGroup targetGroup)
Parameters
Type | Name | Description |
---|---|---|
TargetGroup | targetGroup | The TargetGroup that is saved. |
Returns
Type | Description |
---|---|
TargetGroup | New or updated TargetGroup |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TargetsAgent agent = new TargetsAgent())
{
// call methods on agent here...
}
}