Using a Complex Field Code
The following is an example of a complex field code:
<$ If (Time() - Interaction.DateCreated > 14, “Please accept our apologies for not having replied sooner. ”, “”) $>
This field code inserts a tardiness apology if more than 14 days have elapsed since the interaction first entered the system. It uses the function If, which has these properties:
Its syntax is If (Boolean, TrueResult, FalseResult)
If Boolean evaluates to True, it returns the second argument.
If Boolean evaluates to False, it returns the third argument.
In this example the three arguments of If are as follows:
Time() - Interaction.DateCreated > 14
A formula that returns True if the difference between the date created and the current system time is more than 14 days. (The result of a mathematical operation on dates is given in days.)
“Please accept our apologies for not having replied sooner. ” A text string apologizing for tardiness, inserted if the formula evaluates to True.
The null string: if the reply is not late (the formula evaluates to False), nothing is inserted in it.