0 Replies Latest reply on Jun 17, 2011 9:16 AM by 864013

    Iif and concat problem in email body - solution

      Hi all, it is not a question, just some information if somebody will try to do it:
      If you want to send an email from workflow and use the IIf function with concatenated results, the concat syntax in the help will not work.

      The solution is: Use + character in place of || and so on :)
      For exlampe:
      %%%IIf(PRE('<dDate_field1_ITAG>')<>[<dDate_field1_ITAG>],'Any text '+PRE('<dDate_field1_ITAG>')+'-->'+[<dDate_field1_ITAG>], '')%%%
      The result when the field HAD a value and it is changing to another: Any text 11/11/2011 --> 12/11/2011

      If the field is changing from NULL to something, use this:
      %%%IIf(IfNull(PRE('<dDate_field1_ITAG>'),0)<>[<dDate_field1_ITAG>],'Any text'+PRE('<dDate_field1_ITAG>')+'-->'+[<dDate_field1_ITAG>], '')%%%

      And if U want to see the every change (null -> value, value -> value, and value -> null), use this beauty:
      %%%IIf(IfNull(PRE('<dDate_field1_ITAG>'),0)<>[<dDate_field1_ITAG>] OR ([<dDate_field1_ITAG>] IS NULL AND PRE('<dDate_field1_ITAG>') IS NOT NULL),'Any text'+PRE('<dDate_field1_ITAG>')+'-->'+[<dDate_field1_ITAG>], '')%%%