Class ActivityStatusHelper
This class implements the logic behind the "toggle completed" checkboxes for activities. The public entrypoint ToggleCompleted(String) will toggle the completed status for an activity, i.e., a document, appointment or sale. Appointments may have three state logic enabled through a preference. The changes are saved immediately.
Inherited Members
Namespace: SuperOffice.CRM
Assembly: SoDataBase.dll
Syntax
public static class ActivityStatusHelper
Methods
ExtractKeyAndValue(String, out String, out Int32)
Declaration
public static void ExtractKeyAndValue(string keyAndValue, out string key, out int value)
Parameters
Type | Name | Description |
---|---|---|
String | keyAndValue | |
String | key | |
Int32 | value |
SetCompleted(String, ActivityStatus)
Sets the completed status for an activity, i.e., a document, appointment or sale. Appointments may have three state logic enabled through a preference. The changes are saved immediately. If an invalid id is passed in (nonexistent record), no changes will be made. If there is no write access to the record being changed, a Sentry exception will be thrown in the usual manner.
Declaration
public static void SetCompleted(string keyAndValue, ActivityStatus activityStatus)
Parameters
Type | Name | Description |
---|---|---|
String | keyAndValue | Activity identifier, in the form <key>=<value>, where the key is one of sale_id, appointment_id or document_id; and the value is an integer primary key. |
ActivityStatus | activityStatus | The status to apply. |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if an unknown key string is passed in. |
SoSentryException | Thrown if you do not have WRITE access to the record you're trying to update |
SetCompleted(String, Int32, ActivityStatus)
Sets the completed status for an activity, i.e., a document, appointment or sale. Appointments may have three state logic enabled through a preference. The changes are saved immediately. If an invalid id is passed in (nonexistent record), no changes will be made. If there is no write access to the record being changed, a Sentry exception will be thrown in the usual manner.
Declaration
public static void SetCompleted(string keyName, int id, ActivityStatus activityStatus)
Parameters
Type | Name | Description |
---|---|---|
String | keyName | One of appointment_id, sale_id or document_id |
Int32 | id | Integer primary key of record to toggle |
ActivityStatus | activityStatus | The status to apply |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if an unknown key string is passed in. |
SoSentryException | Thrown if you do not have WRITE access to the record you're trying to update |
ToggleActivity(String, Boolean, ref Boolean)
Declaration
public static ActivityStatus ToggleActivity(string activityIdentifier, bool canSetComplete, ref bool hasChanged)
Parameters
Type | Name | Description |
---|---|---|
String | activityIdentifier | |
Boolean | canSetComplete | |
Boolean | hasChanged |
Returns
Type | Description |
---|---|
ActivityStatus |
ToggleCompleted(String)
Toggle the completed status for an activity, i.e., a document, appointment or sale. Appointments may have three state logic enabled through a preference. The changes are saved immediately. If an invalid id is passed in (nonexistent record), no changes will be made and the value NotStarted will be returned. If there is no write access to the record being changed, a Sentry exception will be thrown in the usual manner.
Declaration
public static ActivityStatus ToggleCompleted(string keyAndValue)
Parameters
Type | Name | Description |
---|---|---|
String | keyAndValue | Activity identifier, in the form <key>=<value>, where the key is one of sale_id, appointment_id or document_id; and the value is an integer primary key. |
Returns
Type | Description |
---|---|
ActivityStatus | New status |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if an unknown key string is passed in. |
SoSentryException | Thrown if you do not have WRITE access to the record you're trying to update |
ToggleCompleted(String, Boolean)
Toggle the completed status for an activity, i.e., a document, appointment or sale. Appointments may have three state logic enabled through a preference. The changes are saved immediately. If an invalid id is passed in (nonexistent record), no changes will be made and the value NotStarted will be returned. If there is no write access to the record being changed, a Sentry exception will be thrown in the usual manner.
Declaration
public static ActivityStatus ToggleCompleted(string keyAndValue, bool canSetComplete)
Parameters
Type | Name | Description |
---|---|---|
String | keyAndValue | Activity identifier, in the form <key>=<value>, where the key is one of sale_id, appointment_id or document_id; and the value is an integer primary key. |
Boolean | canSetComplete | Specifies whether or not we should check if the activity you want to toggle triggers a suggestion. If the activity triggers a suggestion, and the toggle action is from an un-complete to a complete state, this action is not executed. If you are unsure what value this parameter should have, use the ToggleCompleted method without this parameter. The default value is true. |
Returns
Type | Description |
---|---|
ActivityStatus | The new status |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if an unknown key string is passed in. |
SoSentryException | Thrown if you do not have WRITE access to the record you're trying to update |
ToggleCompleted(String, Int32)
Toggle the completed status for an activity, i.e., a document, appointment or sale. Appointments may have three state logic enabled through a preference. The changes are saved immediately. If an invalid id is passed in (nonexistent record), no changes will be made and the value NotStarted will be returned. If there is no write access to the record being changed, a Sentry exception will be thrown in the usual manner.
Declaration
public static ActivityStatus ToggleCompleted(string keyName, int id)
Parameters
Type | Name | Description |
---|---|---|
String | keyName | One of appointment_id, sale_id or document_id |
Int32 | id | Integer primary key of record to toggle |
Returns
Type | Description |
---|---|
ActivityStatus | New status |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if an unknown key string is passed in. |
SoSentryException | Thrown if you do not have WRITE access to the record you're trying to update |
ToggleCompleted(String, Int32, Boolean)
Toggle the completed status for an activity, i.e., a document, appointment or sale. Appointments may have three state logic enabled through a preference. The changes are saved immediately. If an invalid id is passed in (nonexistent record), no changes will be made and the value NotStarted will be returned. If there is no write access to the record being changed, a Sentry exception will be thrown in the usual manner.
Declaration
public static ActivityStatus ToggleCompleted(string keyName, int id, bool canSetComplete)
Parameters
Type | Name | Description |
---|---|---|
String | keyName | One of appointment_id, sale_id or document_id |
Int32 | id | Integer primary key of record to toggle |
Boolean | canSetComplete | Specifies whether or not we should check if the activity you want to toggle triggers a suggestion. If the activity triggers a suggestion, and the toggle action is from an un-complete to a complete state, this action is not executed. If you are unsure what value this parameter should have, use the ToggleCompleted method without this parameter. The default value is true. |
Returns
Type | Description |
---|---|
ActivityStatus | New status |
Exceptions
Type | Condition |
---|---|
SoIllegalOperationException | Thrown if an unknown key string is passed in. |
SoSentryException | Thrown if you do not have WRITE access to the record you're trying to update |