Sana Assistant (online)
Table of Contents

Extension.Api.ErpCommunication.ValueFormatter reference

ValueFormatter provides functionality to format values to strings used in ERP requests. String representation of some data types can differ for different cultures and value formatter formats values according to current ERP preferences.

Methods

Class diagram

FormatBool(bool value)

Formats the specified boolean value to the string used in ERP requests.

string formattedValue = Api.ErpCommunication.ValueFormatter.FormatBool(true);

FormatDate(DateTime value)

Formats the specified date value to the string used in ERP requests. Only date part is sent to the ERP, time is ignored.

string formattedValue = Api.ErpCommunication.ValueFormatter.FormatDate(DateTime.Now);

FormatDateTime(DateTime value)

Formats the specified date and time value to the string used in ERP requests.

string formattedValue = Api.ErpCommunication.ValueFormatter.FormatDateTime(DateTime.Now);

FormatDecimal(decimal value)

Formats the specified decimal value to the string used in ERP requests.

string formattedValue = Api.ErpCommunication.ValueFormatter.FormatDecimal(0.5M);

FormatInt(decimal value)

Formats the specified integer value to the string used in ERP requests.

string formattedValue = Api.ErpCommunication.ValueFormatter.FormatInt(1);

FormatLong(decimal value)

Formats the specified long integer value to the string used in ERP requests.

string formattedValue = Api.ErpCommunication.ValueFormatter.FormatLong(1L);

See also