1 Reply Latest reply on Nov 26, 2014 12:20 PM by dmshimself

    String attribute with calculation won't populate in HTML email - ideas?

    jeffschamberger Rookie

      I haven't been able to figure out how to change the date/time attribute to display the time in a 12-hour format instead of 24-hour format in Web Access.  I'm running into a few issues with the date/time attribute when using it in an email.


      My window has the date/time attribute.  In the console, I set the properties to only display 'date only'.  It works fine in the console and web.  To bypass the 24-hour clock, I simply created a string attribute so the user can type the time format however they would like.  We don't plan to use the time attribute for any reporting or anything so the use is merely for user function.


      The challenge I'm running into is that when the date/time attribute is pulled into an HTML email notification, it shows date and time (even though the user was only asked for the date when entering the form).

      Not only does it look bad, but it then conflicts with the time entered in the Start Time attribute.


      To try to bypass this, I added a 2nd attribute "Start Date Short" with an After Read calculation on it:


      import System


      static def GetAttributeValue(Incident):


      Value = Incident._CMStartDate.ToLocalTime().ToString("MM/dd/yyyy")


      return Value


      The calculation is working (in a way) but it pulls the wrong date:


      Additionally, the attribute will not populate in the HTML email:


      Any ideas where I went wrong with getting it to show:

      1- The correct date

      2- In the email


      Thanks in advance for any help!