Expressions in notification templates

Expressions using C# functions are supported in notification templates.

You can use expressions in both the notification field and the Subject field of a template. With some limitations, you can call any function that returns a string or a value that can be converted using the ToString method.

For example, this expression gets an inspection's scheduled date and time and converts it to a string:

inspection.ScheduledDateTime.ToString()

For another example, this expression converts a work order's completion hours to a string and rounds to two decimal places:

{{workOrder.CompletionHours.ToString("#.00")}}

See this article for more information about string formatting in C#:

https://docs.microsoft.com/en-us/dotnet/standard/base-types/formatting-types#custom-format-strings

The limitations on what functions you can call are based on the same whitelist that is used for formulas in a multi-tenant environment.

See Multi-tenant formula restrictions.

For troubleshooting, if an expression doesn't return a value, check the logs. Infor Public Sector attempts to compile the expressions when you save a template, so you might get errors.