Class UDefFieldCacheBase
Inherited Members
Namespace: SuperOfficeCRMRows
Assembly: SoDataBase.dll
Syntax
public abstract class UDefFieldCacheBase : CacheBaseV2
Constructors
UDefFieldCacheBase(IUdefHelper)
Declaration
protected UDefFieldCacheBase(IUdefHelper udefHelper)
Parameters
| Type | Name | Description |
|---|---|---|
| IUdefHelper | udefHelper |
Fields
_udefHelper
Declaration
protected readonly IUdefHelper _udefHelper
Field Value
| Type | Description |
|---|---|
| IUdefHelper |
Properties
TableNames
Declaration
protected override IEnumerable<string> TableNames { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerablestring |
Overrides
Remarks
Although we read from table "UserPreference" we shouldn't add it to TableNames for this cache because there's too much traffic on that table. Invoking flush on table change would be expensive, so flushing manually is the way to go. "Udeflayout" is a pseudo-table that updates whenever published layout changes.
Methods
CheckRevisionAsync()
Declaration
protected virtual Task CheckRevisionAsync()
Returns
| Type | Description |
|---|---|
| Task |
GetAllPageOneFieldsFromType(UDefType)
Get ALL page one fields from an udef type
Declaration
public ILookup<int, PageOneFieldInfo> GetAllPageOneFieldsFromType(UDefType type)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | type | Udef type |
Returns
| Type | Description |
|---|---|
| ILookupintPageOneFieldInfo | Lists of PageOneFieldInfo elements containing user-defined field definitions and line number (1-based) |
GetFirstFromLabel(UDefType, string)
Get a field definition based on the field label. This method is not safe as field labels are easily changed through the Admin client, and therefore not guaranteed to be constant. Labels are also not enforced unique.
Declaration
public UDefFieldRow GetFirstFromLabel(UDefType type, string label)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | type | Type of udef field to search |
| string | label | Label to look for |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row definition, or null if no match |
Remarks
To improve reliability, this method will strip colon, semicolon, blank, newline, carriage return, tab and minus characters from the front and back of labels, as well as convert to lower case for comparison. The 'label' in-parameter is also treated this way. A sequential search is then made, and the first field found to match is returned.
GetFirstFromLabelWithCulture(UDefType, string, string)
Get a field definition based on the field label, parsed according to a specified culture. This method is not safe as field labels are easily changed through the Admin client, and therefore not guaranteed to be constant. Labels are also not enforced unique.
Declaration
public UDefFieldRow GetFirstFromLabelWithCulture(UDefType type, string label, string culture)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | type | Type of udef field to search |
| string | label | Label to look for |
| string | culture | Culture to apply to labels during parsing |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row definition, or null if no match |
Remarks
Initially, all labels are parsed according to the given culture (labels that do not follow multi-language layout are not touched). Then, this method will strip colon, semicolon, blank, newline, carriage return, tab and minus characters from the front and back of labels, as well as convert to lower case for comparison. The 'label' in-parameter is also treated this way (but not multi-language parsed). A sequential search is then made, and the first field found to match is returned.
GetFromField(SoField)
Get a UDefFieldRow from the field the user-defined value is stored in.
Declaration
public UDefFieldRow GetFromField(SoField field)
Parameters
| Type | Name | Description |
|---|---|---|
| SoField | field | Information about the field |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row holding the definition of the field. 'null' (vb 'Nothing') is returned if there are no rows defined for this field. This would mean that this field does not hold a value for a user-defined field. |
GetFromField(FieldInfo)
Get a UDefFieldRow from the field the user-defined value is stored in.
Declaration
public UDefFieldRow GetFromField(FieldInfo fieldInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| FieldInfo | fieldInfo | Information about the field |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row holding the definition of the field. 'null' (vb 'Nothing') is returned if there are no rows defined for this field. This would mean that this field does not hold a value for a user-defined field. |
GetFromField(int)
Get a UDefFieldRow from the field the user-defined value is stored in.
Declaration
public UDefFieldRow GetFromField(int fieldNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| int | fieldNumber | Information about the field |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row holding the definition of the field. 'null' (vb 'Nothing') is returned if there are no rows defined for this field. This would mean that this field does not hold a value for a user-defined field. |
GetFromFieldLabel(string, UDefType)
Get a UDefFieldRow based on its label.
Declaration
public UDefFieldRow GetFromFieldLabel(string fieldlabel, UDefType type)
Parameters
| Type | Name | Description |
|---|---|---|
| string | fieldlabel | Label is |
| UDefType | type |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row with the matching progid. 'null' (vb 'Nothing') is returned if there are no rows matching. |
Remarks
The label match is fuzzy and not-exact, unlike a prog-id. Leading and trailing spaces are removed, as is trailing punctuation (":" and "."). Multi-language strings (i.e. US:"foo";NO:"bar") are parsed according to the current ui-culture before being matched.
GetFromId(int)
Get a UDefFieldRow from its primary key.
Declaration
public UDefFieldRow GetFromId(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | Primary key of the row. |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row with the primary key. 'null' (vb 'Nothing') is returned if there are no rows with this primary key. |
GetFromProgId(string, UDefType)
Get a UDefFieldRow from its progid
Declaration
public UDefFieldRow GetFromProgId(string progId, UDefType type)
Parameters
| Type | Name | Description |
|---|---|---|
| string | progId | ProgId is composed of an identifier and udefidentity; '[identifier]:[udefIdentity]' Note that a colon is generally used as the separator, and not a dot; this is because the web client (and other applications) tend to use the dot as an indirection operator, like C# does. |
| UDefType | type |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row with the matching progid. 'null' (vb 'Nothing') is returned if there are no rows matching. |
GetFromType(UDefType)
Get a UDefFieldRow collection of definitions for a given udef type
Declaration
public UDefFieldRows GetFromType(UDefType type)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | type | Udef type |
Returns
| Type | Description |
|---|---|
| UDefFieldRows | Field definitions; the collection might be empty if there are no fields defined |
GetFromUDListDefinitionId(int)
Declaration
public UDefFieldRows GetFromUDListDefinitionId(int udListDefinitionId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | udListDefinitionId |
Returns
| Type | Description |
|---|---|
| UDefFieldRows |
GetFromUdefIdentity(int, UDefType)
Get a UDefFieldRow from its udefIdentity.
Declaration
public UDefFieldRow GetFromUdefIdentity(int udefIdentity, UDefType type)
Parameters
| Type | Name | Description |
|---|---|---|
| int | udefIdentity | |
| UDefType | type |
Returns
| Type | Description |
|---|---|
| UDefFieldRow | Row with the matching udefIdentity and type. 'null' (vb 'Nothing') is returned if there are no rows matching. |
GetLineNo(int)
Line number could need some recalculation.
Declaration
protected virtual int GetLineNo(int lineNo)
Parameters
| Type | Name | Description |
|---|---|---|
| int | lineNo |
Returns
| Type | Description |
|---|---|
| int |
GetPageOneFieldsFromType(UDefType)
Get a list of page one fields for given Udef type and current user group. The list may be empty if no fields have been defined. null will be returned if the Udef type is not supported for page one (Appointment, Document).
Declaration
public IEnumerable<PageOneFieldInfo> GetPageOneFieldsFromType(UDefType type)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | type | Udef type |
Returns
| Type | Description |
|---|---|
| IEnumerablePageOneFieldInfo | List of PageOneFieldInfo elements containing user-defined field definitions and line number (1-based) |
GetPageOneFieldsFromType(UDefType, int)
Get a list of page one fields for given Udef type and user group. The list may be empty if no fields have been defined. null will be returned if the Udef type is not supported for page one (Appointment, Document).
Declaration
public IEnumerable<PageOneFieldInfo> GetPageOneFieldsFromType(UDefType type, int userGroupId)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | type | Udef type |
| int | userGroupId | User group to get for |
Returns
| Type | Description |
|---|---|
| IEnumerablePageOneFieldInfo | List of PageOneFieldInfo elements containing user-defined field definitions and line number (1-based) |
GetVersionsAsync()
Get the current udef version array. Override to get either the Admin version or some specific set of versions
Declaration
protected virtual Task<Dictionary<UDefType, int>> GetVersionsAsync()
Returns
| Type | Description |
|---|---|
| TaskDictionaryUDefTypeint |
IsPageOneMDOAsync(UDefType, CancellationToken)
Declaration
protected virtual Task<bool> IsPageOneMDOAsync(UDefType udefType, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| UDefType | udefType | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Taskbool |
LoadOnDemand()
Declaration
protected void LoadOnDemand()
OnLoad()
Declaration
protected override void OnLoad()
Overrides
OnLoadAsync(CancellationToken)
Declaration
protected override Task OnLoadAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |