Show / Hide Table of Contents

Class FieldHelper

Inheritance
object
FieldHelper
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.ErpSync
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
Type Description
string

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
Type Name Description
string timestamp1
string timestamp2
Returns
Type Description
string

EncodeFieldValue(string, FieldMetadataInfo)

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
Type Description
string

FormatFieldValueFromFieldMetadataInfo(string, FieldMetadataInfo)

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
Type Description
string

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
Type Description
Task<string[]>

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
Type Description
Task<Dictionary<string, ImportColumnInfo>>

A dictionary with CrmFieldKeys and import column definntion mapping

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
Type Name Description
ErpActorType actorType
string erpFieldKey
CancellationToken cancellationToken
Returns
Type Description
Task<string>

crm field key

ToDefaultWidth(FieldMetadataTypeInfo)

Declaration
public static string ToDefaultWidth(FieldMetadataTypeInfo ti)
Parameters
Type Name Description
FieldMetadataTypeInfo ti
Returns
Type Description
string

ToDisplayType(FieldMetadataTypeInfo)

Declaration
public static string ToDisplayType(FieldMetadataTypeInfo ti)
Parameters
Type Name Description
FieldMetadataTypeInfo ti
Returns
Type Description
string

ToRestrictionType(FieldMetadataTypeInfo)

Declaration
public static string ToRestrictionType(FieldMetadataTypeInfo ti)
Parameters
Type Name Description
FieldMetadataTypeInfo ti
Returns
Type Description
string

UpdateErpFieldRowFromFieldMetadataInfoAsync(FieldMetadataInfo, ErpFieldRow)

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>

UpdateFieldMetadataInfoFromErpFieldRow(ErpFieldRow, ref FieldMetadataInfo, bool)

Declaration
public static void UpdateFieldMetadataInfoFromErpFieldRow(ErpFieldRow rw, ref FieldMetadataInfo fi, bool useFirstSyncDefaultValue = false)
Parameters
Type Name Description
ErpFieldRow rw
FieldMetadataInfo fi
bool useFirstSyncDefaultValue
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top