<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent”></a> Class UserDefinedFieldInfoAgent
Namespace: SuperOffice.WebApi.AgentsAssembly: SuperOffice.WebApi.dll 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.
Inheritance
object ← AgentBase ← UserDefinedFieldInfoAgentImplements
IUserDefinedFieldInfoAgent, IAgentBase, IDisposableInherited Members
AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T>(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()Examples
<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“http://example.com/super/api”); mySession.Authorization = new AuthorizationUsernamePassword(“user”, “pass”); using (UserDefinedFieldInfoAgent agent = new UserDefinedFieldInfoAgent(mySession)) { // call methods on agent here… }</code></pre>Constructors
<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent__ctor_System_Net_Http_HttpClient_”></a> UserDefinedFieldInfoAgent(HttpClient)
Constructor: 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.Parameters
httpClient HttpClient
Use this HTTP client instead of making own HttpClient instance.
<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> UserDefinedFieldInfoAgent(WebApiOptions, HttpClient)
Constructor: 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.Parameters
options WebApiOptions
Base URL and authentication values.
httpClient HttpClient
Optional: Use this HTTP client instead of making a new one.
Methods
<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_ChangeFieldTypeAsync_SuperOffice_WebApi_Data_UserDefinedFieldInfo_SuperOffice_WebApi_Data_UDefFieldType_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> ChangeFieldTypeAsync(UserDefinedFieldInfo, UDefFieldType, bool, RequestOptions)
Create a UserDefinedFieldInfo based on a owner-entity idParameters
info UserDefinedFieldInfo
The user-defined field info carrier to want to modify
fieldType UDefFieldType
The new field type you want
isIndexed bool
The new indexed status you want
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> Returns the user-defined field info carrier<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_ClearCachesAsync_SuperOffice_WebApi_RequestOptions_”></a> ClearCachesAsync(RequestOptions)
Clear all relevant caches. This is normally done automatically but can be useful in certain circumstances.Parameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_CreateDefaultUserDefinedFieldInfoAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultUserDefinedFieldInfoAsync(RequestOptions)
Set default values into a new UserDefinedFieldInfo. NetServer calculates default values on the entity, which is required when creating/storing a new instanceParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> A blank UserDefinedFieldInfo<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_CreateUserDefinedFieldInfoAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_Data_UDefFieldType_SuperOffice_WebApi_RequestOptions_”></a> CreateUserDefinedFieldInfoAsync(UDefType, UDefFieldType, RequestOptions)
Create a UserDefinedFieldInfo based on a owner-entity idParameters
ownerType UDefType
The user-defined field owner-entity id.
fieldType UDefFieldType
The field type of the new field
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> Returns the user-defined field info carrier<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_DeleteUserDefinedFieldInfoAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteUserDefinedFieldInfoAsync(int, RequestOptions)
Deletes the UserDefinedFieldInfoParameters
userDefinedFieldInfoId int
The identity of the UserDefinedFieldInfo
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_DetectColumnIdChangesAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> DetectColumnIdChangesAsync(UDefType, RequestOptions)
Detect columnid changes to the admin version (for determining publish warning)Parameters
ownerType UDefType
The owner type
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> Returns true if columnid changes where found. i.e. if data needs to be moved during publishing.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_DetectUnpublishedChangesAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> DetectUnpublishedChangesAsync(UDefType, RequestOptions)
Detect changes to the admin version (unpublished)Parameters
ownerType UDefType
The owner type
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool> Returns true if any changes were found. This includes cosmetic changes.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_FigureOutListIdFromListTableIdAndUDListDefinitionIdAsync_SuperOffice_WebApi_Data_UserDefinedFieldInfo_SuperOffice_WebApi_RequestOptions_”></a> FigureOutListIdFromListTableIdAndUDListDefinitionIdAsync(UserDefinedFieldInfo, RequestOptions)
Kind of the reverse of SetListTableIdAndUDListDefinitionIdFromSelectedListIdParameters
info UserDefinedFieldInfo
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int><a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetChangedPageOneFieldsAsync_SuperOffice_WebApi_Data_UDefType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetChangedPageOneFieldsAsync(UDefType, int, RequestOptions)
Gets which page one fields have changed from the current versionParameters
ownerType UDefType
The user-defined field owner-entity.
userGroupId int
Id of UserGroup
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool[]><a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetCustomFieldInfoAsync_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetCustomFieldInfoAsync(string, string, RequestOptions)
Return information about a particular custom field (user-defined + extra) on a particular tableParameters
tableName string
The name of table that owns the custom fields. e.g. ‘contact’, ‘person’, ‘project’ etc.
fieldName string
The name of the field: prog:id or field name. e.g. ‘SuperOffice:21’ or ‘x_foobar’
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<FieldInfoBase> user-defined or extra field info. Describes default values, mandatory, visiblity, labels and choices.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetCustomFieldInfoListAsync_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> GetCustomFieldInfoListAsync(string, bool, RequestOptions)
Return information about all the custom fields (user-defined + extra) on a particular tableParameters
tableName string
The name of table that owns the custom fields. e.g. ‘contact’, ‘person’, ‘project’ etc.
includeStandard bool
Include standard fields in result. Default false.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<FieldInfoBase[]> Array of user-defined and extra field info in rank order. Describes default values, mandatory, visiblity, labels and choices.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetPublishedUserDefinedFieldFromFieldLabelAsync_System_String_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> GetPublishedUserDefinedFieldFromFieldLabelAsync(string, UDefType, RequestOptions)
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.Parameters
fieldLabel string
The field label - the text label shown in the user interface. Trailing spaces and punctuation (”:” and ”.”) are ignored when searching.
ownerType UDefType
The user-defined field owner-entity id.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> Returns the user-defined field info carrier, or null if no matching field is found.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetPublishedUserDefinedFieldFromProgIdAsync_System_String_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> GetPublishedUserDefinedFieldFromProgIdAsync(string, UDefType, RequestOptions)
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.Parameters
progId string
The prog.id is a hidden name that uniquely identifies the field.
ownerType UDefType
The user-defined field owner-entity id.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> Returns the user-defined field info carrier, or null if no matching field is found.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetPublishedUserDefinedFieldListAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> GetPublishedUserDefinedFieldListAsync(UDefType, RequestOptions)
Return information about all the user defined fields on a particular owner type (project, contact, person, etc).Parameters
ownerType UDefType
The user-defined field owner-entity id.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo[]> Returns an array of user-defined field info carriers.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetPublishedUserDefinedPageOneFieldsAsync_SuperOffice_WebApi_Data_UDefType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPublishedUserDefinedPageOneFieldsAsync(UDefType, int, RequestOptions)
Get a list of page one fields for given Udef type and current user groupParameters
ownerType UDefType
The user-defined field owner-entity.
userGroupId int
Id of UserGroup
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo[]> Returns an array of page one user-defined field info carriers.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetUserDefinedFieldFromFieldLabelAsync_System_String_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> GetUserDefinedFieldFromFieldLabelAsync(string, UDefType, RequestOptions)
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.Parameters
fieldLabel string
The field label - the text label shown in the user interface. Trailing spaces and punctuation (”:” and ”.”) are ignored when searching.
ownerType UDefType
The user-defined field owner-entity id.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> Returns the user-defined field info carrier, or null if no matching field is found.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetUserDefinedFieldFromIdsAsync_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> GetUserDefinedFieldFromIdsAsync(int[], RequestOptions)
Return an given array of user defined field identified by the ids.Parameters
ids int[]
Array of user defined field ids
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo[]> Returns an array of user-defined field info carriers<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetUserDefinedFieldFromProgIdAsync_System_String_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> GetUserDefinedFieldFromProgIdAsync(string, UDefType, RequestOptions)
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.Parameters
progId string
The prog.id is a hidden name that uniquely identifies the field.
ownerType UDefType
The user-defined field owner-entity id.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> Returns the user-defined field info carrier, or null if no matching field is found.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetUserDefinedFieldFromProgIdsAsync_System_String___SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> GetUserDefinedFieldFromProgIdsAsync(string[], UDefType, RequestOptions)
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.Parameters
progIds string[]
The prog.id is a hidden name that uniquely identifies the field.
ownerType UDefType
The user-defined field owner-entity id.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo[]> Returns an array of user-defined field info carriers<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetUserDefinedFieldInfoAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetUserDefinedFieldInfoAsync(int, RequestOptions)
Gets a specific UserDefinedFieldInfo object.Parameters
userDefinedFieldInfoId int
The identifier of the UserDefinedFieldInfo object
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> UserDefinedFieldInfo<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetUserDefinedFieldListAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> GetUserDefinedFieldListAsync(UDefType, RequestOptions)
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.Parameters
ownerType UDefType
The user-defined field owner-entity id.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo[]> Returns an array of user-defined field info carriers.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_GetUserDefinedPageOneFieldsAsync_SuperOffice_WebApi_Data_UDefType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetUserDefinedPageOneFieldsAsync(UDefType, int, RequestOptions)
Get a list of page one fields for given Udef type and current user groupParameters
ownerType UDefType
The user-defined field owner-entity.
userGroupId int
Id of UserGroup
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo[]> Returns an array of page one user-defined field info carriers.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_IsAnyPublishEventActiveAsync_SuperOffice_WebApi_RequestOptions_”></a> IsAnyPublishEventActiveAsync(RequestOptions)
Check if any publish events are activeParameters
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool><a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_IsPublishEventActiveAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> IsPublishEventActiveAsync(UDefType, RequestOptions)
Check if the publish event is active for the given typeParameters
type UDefType
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<bool><a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_PublishAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> PublishAsync(UDefType, RequestOptions)
Publish changed Udef fields for the given owner typeParameters
ownerType UDefType
The owner type to publish for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<int> Batch task id or 0 that handles publishing.<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_RevertAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> RevertAsync(UDefType, RequestOptions)
Revert changed Udef fields for the given owner type - all unpublished changes will be lostParameters
ownerType UDefType
The owner type to revert fields for
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_SaveUserDefinedFieldInfoAsync_SuperOffice_WebApi_Data_UserDefinedFieldInfo_SuperOffice_WebApi_RequestOptions_”></a> SaveUserDefinedFieldInfoAsync(UserDefinedFieldInfo, RequestOptions)
Updates the existing UserDefinedFieldInfo or creates a new UserDefinedFieldInfo if the id parameter is 0.Parameters
userDefinedFieldInfo UserDefinedFieldInfo
The UserDefinedFieldInfo that is saved.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo> New or updated UserDefinedFieldInfo<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_SaveUserDefinedFieldInfosAsync_SuperOffice_WebApi_Data_UserDefinedFieldInfo___SuperOffice_WebApi_RequestOptions_”></a> SaveUserDefinedFieldInfosAsync(UserDefinedFieldInfo[], RequestOptions)
Save an array of user defined fields. This will update the unpublished layout.Parameters
infos UserDefinedFieldInfo[]
An array of user defined fields
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_SetListTableIdAndUDListDefinitionIdFromSelectedListIdAsync_SuperOffice_WebApi_Data_UserDefinedFieldInfo_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> SetListTableIdAndUDListDefinitionIdFromSelectedListIdAsync(UserDefinedFieldInfo, int, RequestOptions)
Make stuff similar to what happens in the win clientParameters
info UserDefinedFieldInfo
selectedListId int
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<UserDefinedFieldInfo><a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_SetPageOneFieldGroupingAsync_SuperOffice_WebApi_Data_UDefType_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> SetPageOneFieldGroupingAsync(UDefType, bool, RequestOptions)
Sets the Page One Field grouping for a specific entityParameters
ownerType UDefType
The user-defined field owner-entity.
active bool
If true, use grouping
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_SetPublishStartSystemEventAsync_SuperOffice_WebApi_Data_UDefType_SuperOffice_WebApi_RequestOptions_”></a> SetPublishStartSystemEventAsync(UDefType, RequestOptions)
Set the start flag for udef publishing. Must be called before PUBLISH, or PUBLISH will fail. Start flag is removed when publish process completes.Parameters
ownerType UDefType
The user-defined field owner-entity.
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_SetRankOnFieldsAsync_SuperOffice_WebApi_Data_UDefType_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> SetRankOnFieldsAsync(UDefType, int[], RequestOptions)
Change rank of user defined fieldsParameters
ownerType UDefType
The user-defined field owner-entity.
rankedFieldsIds int[]
All IDs of this owner-entity in desired rank order
requestOptions RequestOptions
Override language/culture codes on this request.
Returns
Task<a id=“SuperOffice_WebApi_Agents_UserDefinedFieldInfoAgent_SetUserDefinedPageOneFieldAsync_SuperOffice_WebApi_Data_UDefType_System_Int32_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> SetUserDefinedPageOneFieldAsync(UDefType, int, int, int, RequestOptions)
Sets a user defined fields as page one field.Parameters
ownerType UDefType
The user-defined field owner entity
udefFieldId int
The id of the udeffield to set as page one field
userGroupId int
The usergroup id to associate the page one field with.
fieldLineNo int
Page one line number
requestOptions RequestOptions
Override language/culture codes on this request.