Expand my Community achievements bar.

Join us LIVE in San Francisco on November 14th for Experience Makers The Skill Exchange. Don't miss out on this free learning event!
SOLVED

custom form date fields--handled differently by module

Avatar

Level 7

We've got a custom project form that contains a field for the project's recording date; the field is set up to show only the date, not the time of day.  I'm working on an automation, triggered by an addition or change to this date field, that adjusts the planned start date for the corresponding recording task to match.

I first tested the scenario using hard-coded info from a sample project.  I used a Read a Record module to pull the field info--it shows the field only as a date:

read a record date.png

I parsed this date and added 7 hours to it before passing it to the Update Record module for the task (our Fusion is on Denver time, and we're on EST, so this results in the date having a 9:00am time).  This worked fine.

I then started playing around with triggers.  I created a second scenario with a Watch Field module to detect changes in the recording date field.  The task gets updated with this scenario but with the wrong time.  I started inspecting the modules, and I discovered that the Watch Field module shows the old and new dates with time values--in this case, 6 hours before the correct dates:

watch fied date with time.png

The first scenario works because Fusion views my 2024-09-20 date as 9/20/24 12:00am.  Why does the Watch Field module (which apparently creates journal entries) use earlier times?

Thanks.

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 7

Ah, figured it out.  In my original scenario I was parsing the newDatVal, which is listed as a Journal Entry object under the Watch Field module output.  If I explicitly tell the Watch Field module to output my custom date field and then parse THAT, I get the correct result.

View solution in original post

3 Replies

Avatar

Level 7

I tried a Watch Events/Read a Record combo instead, and it works properly (it treats the underlying custom date field with a timestamp of 12:00am).

Out of curiosity I created a new custom date field (that does not display time of day) on a form in our sandbox.  I set the field to be tracked in update feeds and then entered a date in a test project.  When I created a journal entry report, the entry shows the new value as the preceding day at 8pm.  I can't find any documentation on this, and it makes zero sense to me.  I may reach out to support to see if they can explain the reasoning.

Avatar

Level 7

Ugh, I think it's using UTC when no time is specified.  It's curious though that this only comes into play when the Watch Field module is used.

Avatar

Correct answer by
Level 7

Ah, figured it out.  In my original scenario I was parsing the newDatVal, which is listed as a Journal Entry object under the Watch Field module output.  If I explicitly tell the Watch Field module to output my custom date field and then parse THAT, I get the correct result.