Class FieldHelper
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public static class FieldHelper
Methods
CreateErpSyncActorFieldFromRow(ErpFieldRow)
Create a new ErpSyncActorField from an erpfield row
Declaration
public static ErpSyncActorField CreateErpSyncActorFieldFromRow(ErpFieldRow rw)
Parameters
Type |
Name |
Description |
ErpFieldRow |
rw |
The row from the erpfield table to create the new ErpSyncActorField
|
Returns
Type |
Description |
ErpSyncActorField |
A complete ErpSyncActorField with values from the database
|
DecodeFieldValueToString(string)
Decodes a given fieldvalue into a string for sending to a connection, by removing tags and possibly changing formats
Declaration
public static string DecodeFieldValueToString(string fieldValue)
Parameters
Type |
Name |
Description |
string |
fieldValue |
The value, as used in EIS (with udef tags, etc)
|
Returns
DetermineLargestTimestamp(string, string)
Compares two timestamps and attempts to determine which one is higher. Returns the higher of the two.
Declaration
public static string DetermineLargestTimestamp(string timestamp1, string timestamp2)
Parameters
Returns
Encodes a given fieldvalue for use in EIS, by adding tags and standardising formats
Declaration
public static string EncodeFieldValue(string fieldValue, FieldMetadataInfo fi)
Parameters
Type |
Name |
Description |
string |
fieldValue |
The value, as delivered by a connection
|
FieldMetadataInfo |
fi |
The FieldMetadataInfo object describing the desired return field's properties
|
Returns
Formats a string according to a specified FieldMetadataInfo object (data type, max length, etc). Useful when sending the field value between connections
Declaration
public static string FormatFieldValueFromFieldMetadataInfo(string value, FieldMetadataInfo fmi)
Parameters
Type |
Name |
Description |
string |
value |
|
FieldMetadataInfo |
fmi |
|
Returns
GetCrmFieldKeysAsync(int, ErpActorType, string[], CancellationToken)
Get corresponding crmFieldKeys given the erpFieldKeys
Declaration
public static Task<string[]> GetCrmFieldKeysAsync(int erpConnectionId, ErpActorType erpActorType, string[] erpFieldKeys, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
int |
erpConnectionId |
The ERP connection
|
ErpActorType |
erpActorType |
The Erp Actor to check for
|
string[] |
erpFieldKeys |
The ERP keys you want to convert
|
CancellationToken |
cancellationToken |
|
Returns
GetImportColumnFromEisFieldAsync(int, ErpActorType, CancellationToken)
Returns a dictionary which contains a mapping between EIS CrmFieldKeys and the import column definition
Declaration
public static Task<Dictionary<string, ImportColumnInfo>> GetImportColumnFromEisFieldAsync(int erpConnectionId, ErpActorType erpActorType, CancellationToken cancellationToken)
Parameters
Type |
Name |
Description |
int |
erpConnectionId |
The ERP connection id
|
ErpActorType |
erpActorType |
The erp actor type
|
CancellationToken |
cancellationToken |
|
Returns
GetMatchingCrmFieldKeyAsync(ErpActorType, string, CancellationToken)
Try to find matching crm field from erp field key
Declaration
public static Task<string> GetMatchingCrmFieldKeyAsync(ErpActorType actorType, string erpFieldKey, CancellationToken cancellationToken = default)
Parameters
Returns
Declaration
public static string ToDefaultWidth(FieldMetadataTypeInfo ti)
Parameters
Type |
Name |
Description |
FieldMetadataTypeInfo |
ti |
|
Returns
Declaration
public static string ToDisplayType(FieldMetadataTypeInfo ti)
Parameters
Type |
Name |
Description |
FieldMetadataTypeInfo |
ti |
|
Returns
Declaration
public static string ToRestrictionType(FieldMetadataTypeInfo ti)
Parameters
Type |
Name |
Description |
FieldMetadataTypeInfo |
ti |
|
Returns
Updates an ErpFieldRow with info/data from a FieldMetadataInfo object
Declaration
public static Task<ErpFieldRow> UpdateErpFieldRowFromFieldMetadataInfoAsync(FieldMetadataInfo fi, ErpFieldRow rw)
Parameters
Type |
Name |
Description |
FieldMetadataInfo |
fi |
|
ErpFieldRow |
rw |
|
Returns
Type |
Description |
Task<ErpFieldRow> |
|
Declaration
public static void UpdateFieldMetadataInfoFromErpFieldRow(ErpFieldRow rw, ref FieldMetadataInfo fi, bool useFirstSyncDefaultValue = false)
Parameters
Type |
Name |
Description |
ErpFieldRow |
rw |
|
FieldMetadataInfo |
fi |
|
bool |
useFirstSyncDefaultValue |
|