EDI Export - Advanced Helper Functions

EDI Export - Advanced Helper Functions

EDI Export - Advanced Helper Functions


This article will show you the avaliable helper functions to display data in meaningful ways on you report.


Replace Lookup

Takes the input string and replaces Value1 with Value2 for each occurance
Code: {ReplaceLookup(input, [Value1|Value2])}

Returns: String with replacement commplete


Total number of pallets on a consignment

Code: {ConsignmentTotalPallets(idConsignment)}

Returns: Number


Total number of non pallet items on a consignment

Code: {ConsignmentTotalNonPallets(idConsignment)}

Returns: Number


Trim or Pad a string to a length to the right

Code: {TrimPad(string, length)}

Returns: "TEST     "



Trim or Pad a string to a length to the left

Code: {TrimPadLeft(string, length, padValue)}

Returns: "     TEST"


Max width of a string in characters

Code: {Max(str, length)}

Returns: " TESTIN"



Hour Range

Provides a time range an hour before and an hour have the tame passed in

Code: {HourRange(object dateTime)}

Returns: " 13:45-15:45"



Split string on a character and return a specific element

This function enables you to split a string based on a character and return a specific element of that back

Code: {Split(String, Split Value, ReturnNumber)}

Example: {Split("this|is|a|test", string "|", 1)}

Returns: " this"


Dates

@Model.Date

That would output a string in the default culture date time string. For greater control, you could do the following:

@Model.DateDateTime which converts the string to a datetime object which then allows all .net functions such as @Model.DateDateTime.ToString(“dd/MM/yyyy”)

@Model.DateDateTimeUTC – same as above, but in place of the client time zone will be UTC time

@Model.EventLocationDateTime – same as above, but the timezone of the event. Only used if client has multi offices with different timezones.


Same for decimal, example @Model.Cubic would be a string, if we need to call .net functions, can convert to a decimal via:

@Model.CubicDecimal then allows things like @Model.CubicDecimal.ToString(“n3”) which would be converted to 3 decimal places with standard 1000 , format