Interface IUserDefinedFieldInfoAgent
Interface for the UserDefinedFieldInfo Agent Returns information about user-defined fields, like field type, field size, field label text, default value. Does not return the actual values in the user-defined fields. The values are returned on the entity objects.
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("UserDefinedFieldInfo Agent", "Interface for the UserDefinedFieldInfo Agent. Returns information about user-defined fields, like field type, field size, field label text, default value. Does not return the actual values in the user-defined fields. The values are returned on the entity objects.")]
public interface IUserDefinedFieldInfoAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (UserDefinedFieldInfoAgent agent = new UserDefinedFieldInfoAgent())
{
// call methods on agent here...
}
}
Methods
ChangeFieldTypeAsync(UserDefinedFieldInfo, UDefFieldType, bool, CancellationToken)
Create a UserDefinedFieldInfo based on a owner-entity id
Declaration
Task<UserDefinedFieldInfo> ChangeFieldTypeAsync(UserDefinedFieldInfo info, UDefFieldType fieldType, bool isIndexed, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserDefinedFieldInfo | info | The user-defined field info carrier to want to modify |
| UDefFieldType | fieldType | The new field type you want |
| bool | isIndexed | The new indexed status you want |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | Returns the user-defined field info carrier |
ClearCachesAsync(CancellationToken)
Clear all relevant caches. This is normally done automatically but can be useful in certain circumstances.
Declaration
Task ClearCachesAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
CreateDefaultUserDefinedFieldInfoAsync(CancellationToken)
Loading default values into a new UserDefinedFieldInfo.
Declaration
Task<UserDefinedFieldInfo> CreateDefaultUserDefinedFieldInfoAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | New UserDefinedFieldInfo with default values |
CreateUserDefinedFieldInfoAsync(UDefType, UDefFieldType, CancellationToken)
Create a UserDefinedFieldInfo based on a owner-entity id
Declaration
Task<UserDefinedFieldInfo> CreateUserDefinedFieldInfoAsync(UDefType ownerType, UDefFieldType fieldType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity id. |
| UDefFieldType | fieldType | The field type of the new field |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | Returns the user-defined field info carrier |
DeleteUserDefinedFieldInfoAsync(int, CancellationToken)
Deletes the UserDefinedFieldInfo
Declaration
Task DeleteUserDefinedFieldInfoAsync(int userDefinedFieldInfoId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userDefinedFieldInfoId | The identity of the UserDefinedFieldInfo |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | This method has no return value |
DetectColumnIdChangesAsync(UDefType, CancellationToken)
Detect columnid changes to the admin version (for determining publish warning)
Declaration
Task<bool> DetectColumnIdChangesAsync(UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The owner type |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if columnid changes where found. i.e. if data needs to be moved during publishing. |
DetectUnpublishedChangesAsync(UDefType, CancellationToken)
Detect changes to the admin version (unpublished)
Declaration
Task<bool> DetectUnpublishedChangesAsync(UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The owner type |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns true if any changes were found. This includes cosmetic changes. |
FigureOutListIdFromListTableIdAndUDListDefinitionIdAsync(UserDefinedFieldInfo, CancellationToken)
Kind of the reverse of SetListTableIdAndUDListDefinitionIdFromSelectedListId
Declaration
Task<int> FigureOutListIdFromListTableIdAndUDListDefinitionIdAsync(UserDefinedFieldInfo info, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserDefinedFieldInfo | info | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<int> |
GetChangedPageOneFieldsAsync(UDefType, int, CancellationToken)
Gets which page one fields have changed from the current version
Declaration
Task<bool[]> GetChangedPageOneFieldsAsync(UDefType ownerType, int userGroupId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity. |
| int | userGroupId | Id of UserGroup |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool[]> |
GetCustomFieldInfoAsync(string, string, CancellationToken)
Return information about a particular custom field (user-defined + extra) on a particular table
Declaration
Task<FieldInfoBase> GetCustomFieldInfoAsync(string tableName, string fieldName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | tableName | The name of table that owns the custom fields. e.g. 'contact', 'person', 'project' etc. |
| string | fieldName | The name of the field: prog:id or field name. e.g. 'SuperOffice:21' or 'x_foobar' |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<FieldInfoBase> | user-defined or extra field info. Describes default values, mandatory, visiblity, labels and choices. |
GetCustomFieldInfoListAsync(string, bool, CancellationToken)
Return information about all the custom fields (user-defined + extra) on a particular table
Declaration
Task<FieldInfoBase[]> GetCustomFieldInfoListAsync(string tableName, bool includeStandard, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | tableName | The name of table that owns the custom fields. e.g. 'contact', 'person', 'project' etc. |
| bool | includeStandard | Include standard fields in result. Default false. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<FieldInfoBase[]> | Array of user-defined and extra field info in rank order. Describes default values, mandatory, visiblity, labels and choices. |
GetPublishedUserDefinedFieldFromFieldLabelAsync(string, UDefType, CancellationToken)
Return information about the given user defined field identified by the owner and the field label. Note that field labels are fuzzy. Leading and trailing spaces and punctuation are ignored.
Declaration
Task<UserDefinedFieldInfo> GetPublishedUserDefinedFieldFromFieldLabelAsync(string fieldLabel, UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fieldLabel | The field label - the text label shown in the user interface. Trailing spaces and punctuation (":" and ".") are ignored when searching. |
| UDefType | ownerType | The user-defined field owner-entity id. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | Returns the user-defined field info carrier, or null if no matching field is found. |
GetPublishedUserDefinedFieldFromProgIdAsync(string, UDefType, CancellationToken)
Return information about the given user defined field identified by the owner and the prog-id. The prog-id is used as the key in the entity carriers.
Declaration
Task<UserDefinedFieldInfo> GetPublishedUserDefinedFieldFromProgIdAsync(string progId, UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | progId | The prog.id is a hidden name that uniquely identifies the field. |
| UDefType | ownerType | The user-defined field owner-entity id. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | Returns the user-defined field info carrier, or null if no matching field is found. |
GetPublishedUserDefinedFieldListAsync(UDefType, CancellationToken)
Return information about all the user defined fields on a particular owner type (project, contact, person, etc).
Declaration
Task<UserDefinedFieldInfo[]> GetPublishedUserDefinedFieldListAsync(UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity id. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo[]> | Returns an array of user-defined field info carriers. |
GetPublishedUserDefinedPageOneFieldsAsync(UDefType, int, CancellationToken)
Get a list of page one fields for given Udef type and current user group
Declaration
Task<UserDefinedFieldInfo[]> GetPublishedUserDefinedPageOneFieldsAsync(UDefType ownerType, int userGroupId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity. |
| int | userGroupId | Id of UserGroup |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo[]> | Returns an array of page one user-defined field info carriers. |
GetUserDefinedFieldFromFieldLabelAsync(string, UDefType, CancellationToken)
Return information about the given user defined field identified by the owner and the field label. Note that field labels are fuzzy. Leading and trailing spaces and punctuation are ignored. Note this may be different than the currently published fields.
Declaration
Task<UserDefinedFieldInfo> GetUserDefinedFieldFromFieldLabelAsync(string fieldLabel, UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fieldLabel | The field label - the text label shown in the user interface. Trailing spaces and punctuation (":" and ".") are ignored when searching. |
| UDefType | ownerType | The user-defined field owner-entity id. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | Returns the user-defined field info carrier, or null if no matching field is found. |
GetUserDefinedFieldFromIdsAsync(int[], CancellationToken)
Return an given array of user defined field identified by the ids.
Declaration
Task<UserDefinedFieldInfo[]> GetUserDefinedFieldFromIdsAsync(int[] ids, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | ids | Array of user defined field ids |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo[]> | Returns an array of user-defined field info carriers |
GetUserDefinedFieldFromProgIdAsync(string, UDefType, CancellationToken)
Return information about the given user defined field identified by the owner and the prog-id. The prog-id is used as the key in the entity carriers. Note this may be different than the currently published fields.
Declaration
Task<UserDefinedFieldInfo> GetUserDefinedFieldFromProgIdAsync(string progId, UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | progId | The prog.id is a hidden name that uniquely identifies the field. |
| UDefType | ownerType | The user-defined field owner-entity id. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | Returns the user-defined field info carrier, or null if no matching field is found. |
GetUserDefinedFieldFromProgIdsAsync(string[], UDefType, CancellationToken)
Return an given array user defined field identified by the owner and the prog-ids. The prog-id is used as the key in the entity carriers. Note this may be different than the currently published field layout.
Declaration
Task<UserDefinedFieldInfo[]> GetUserDefinedFieldFromProgIdsAsync(string[] progIds, UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | progIds | The prog.id is a hidden name that uniquely identifies the field. |
| UDefType | ownerType | The user-defined field owner-entity id. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo[]> | Returns an array of user-defined field info carriers |
GetUserDefinedFieldInfoAsync(int, CancellationToken)
Gets a UserDefinedFieldInfo object.
Declaration
Task<UserDefinedFieldInfo> GetUserDefinedFieldInfoAsync(int userDefinedFieldInfoId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | userDefinedFieldInfoId | The identifier of the UserDefinedFieldInfo object |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | A single UserDefinedFieldInfo |
GetUserDefinedFieldListAsync(UDefType, CancellationToken)
Return information about all the user defined fields on a particular owner type (project, contact, person, etc). Note this may be different than the currently published fields.
Declaration
Task<UserDefinedFieldInfo[]> GetUserDefinedFieldListAsync(UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity id. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo[]> | Returns an array of user-defined field info carriers. |
GetUserDefinedPageOneFieldsAsync(UDefType, int, CancellationToken)
Get a list of page one fields for given Udef type and current user group
Declaration
Task<UserDefinedFieldInfo[]> GetUserDefinedPageOneFieldsAsync(UDefType ownerType, int userGroupId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity. |
| int | userGroupId | Id of UserGroup |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo[]> | Returns an array of page one user-defined field info carriers. |
IsAnyPublishEventActiveAsync(CancellationToken)
Check if any publish events are active
Declaration
Task<bool> IsAnyPublishEventActiveAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
IsPublishEventActiveAsync(UDefType, CancellationToken)
Check if the publish event is active for the given type
Declaration
Task<bool> IsPublishEventActiveAsync(UDefType type, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | type | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
PublishAsync(UDefType, CancellationToken)
Publish changed Udef fields for the given owner type
Declaration
Task<int> PublishAsync(UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The owner type to publish for |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<int> | Batch task id or 0 that handles publishing. |
RevertAsync(UDefType, CancellationToken)
Revert changed Udef fields for the given owner type - all unpublished changes will be lost
Declaration
Task RevertAsync(UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The owner type to revert fields for |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SaveUserDefinedFieldInfoAsync(UserDefinedFieldInfo, CancellationToken)
Updates the existing UserDefinedFieldInfo or creates a new UserDefinedFieldInfo if the id parameter is 0.
Declaration
Task<UserDefinedFieldInfo> SaveUserDefinedFieldInfoAsync(UserDefinedFieldInfo userDefinedFieldInfo, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserDefinedFieldInfo | userDefinedFieldInfo | The UserDefinedFieldInfo that is saved |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> | New or updated UserDefinedFieldInfo |
SaveUserDefinedFieldInfosAsync(UserDefinedFieldInfo[], CancellationToken)
Save an array of user defined fields. This will update the unpublished layout.
Declaration
Task SaveUserDefinedFieldInfosAsync(UserDefinedFieldInfo[] infos, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserDefinedFieldInfo[] | infos | An array of user defined fields |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SetListTableIdAndUDListDefinitionIdFromSelectedListIdAsync(UserDefinedFieldInfo, int, CancellationToken)
Make stuff similar to what happens in the win client
Declaration
Task<UserDefinedFieldInfo> SetListTableIdAndUDListDefinitionIdFromSelectedListIdAsync(UserDefinedFieldInfo info, int selectedListId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UserDefinedFieldInfo | info | |
| int | selectedListId | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<UserDefinedFieldInfo> |
SetPageOneFieldGroupingAsync(UDefType, bool, CancellationToken)
Sets the Page One Field grouping for a specific entity
Declaration
Task SetPageOneFieldGroupingAsync(UDefType ownerType, bool active, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity. |
| bool | active | If true, use grouping |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SetPublishStartSystemEventAsync(UDefType, CancellationToken)
Set the start flag for udef publishing. Must be called before PUBLISH, or PUBLISH will fail. Start flag is removed when publish process completes.
Declaration
Task SetPublishStartSystemEventAsync(UDefType ownerType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SetRankOnFieldsAsync(UDefType, int[], CancellationToken)
Change rank of user defined fields
Declaration
Task SetRankOnFieldsAsync(UDefType ownerType, int[] rankedFieldsIds, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner-entity. |
| int[] | rankedFieldsIds | All IDs of this owner-entity in desired rank order |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
SetUserDefinedPageOneFieldAsync(UDefType, int, int, int, CancellationToken)
Sets a user defined fields as page one field.
Declaration
Task SetUserDefinedPageOneFieldAsync(UDefType ownerType, int udefFieldId, int userGroupId, int fieldLineNo, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | ownerType | The user-defined field owner entity |
| int | udefFieldId | The id of the udeffield to set as page one field |
| int | userGroupId | The usergroup id to associate the page one field with. |
| int | fieldLineNo | Page one line number |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |