DateTime field set to Today used to show current date AND time. It now does current date but always shows 12:00 as the time.

  • 3
  • Problem
  • Updated 1 year ago
  • Solved
  • (Edited)
I am creating a New Record. I created a condition to set the DateTime field to Today.  My end users tell me that it used to show todays date and current time.  It is now setting the date to Today's date but the time is always showing 12:00.  It makes sense that Today is not Now() and thus would set the date but not the time.  But I am told that it used to do both (I honestly don't remember if it did or not but multiple users claim it did).  

Regardless, it would be cool to add NOW() as an option on DateTimeFields.  Is there a best case way of setting a datetime field to Now() but allowing any date or time to be entered if necessary.  Thank you!
Photo of Rich Slack

Rich Slack

  • 4,134 Points 4k badge 2x thumb

Posted 2 years ago

  • 3
Photo of Dave

Dave

  • 5,538 Points 5k badge 2x thumb
Hi Rich,

It is suppose to be NOW() when u select today on a date/time type of field.

I'm on Skuid V8.13 and it works fine.

Looking in releases I see the latest release has a note that this issue has been fixed

 Rockaway Point Release - Iteration 10: [SKUID-2387] - "TODAY" resolves to midnight instead of Current Time

If not on latest version, please update and it should work
Photo of Rich Slack

Rich Slack

  • 4,134 Points 4k badge 2x thumb
Thanks Dave I was on 8.15.7 and had the bug so I just upgraded to 8.15.8

I logged out and logged back in for good measure and am still seeing the same behavior.

12:00 am is still listed but it is 4:17pm


Here is the back end

And the filter set to "TODAY".

Thanks for the reply Dave.  I may be doing something wrong but it appears to still have the same behavior somewhere between 8.13 and  8.15.8.  
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,426 Points 10k badge 2x thumb
Rich,

I updated to 8.15.8 in my developer org and I am seeing the same behavior.  Setting a condition on a date/time field to 'TODAY' only sets the date.  The time stays at 12AM.

I've experienced this with a client as well.  We've been editing the XML and manually update the condition from 'TODAY' to 'NOW'.

Thanks,

Bill
Photo of Rich Slack

Rich Slack

  • 4,134 Points 4k badge 2x thumb
When I tried that Bill I got the correct time, but I also got the following error:
"AND(Date_Time__c = NOW) LIMIT 1 Error:expecting a colon, found 'NOW'"

Are you getting this error?
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,426 Points 10k badge 2x thumb
Rich,

I am not getting this error.  Here is a sample of the xml for the condition:

                <condition type="fieldvalue" value="NOW" enclosevalueinquotes="false" field="ReminderDateTime"/>

Are you querying the model after saving it?

Thanks,

Bill
I also had this issue and had to manually change it to "NOW". Working fine now.
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Hi Rich and Bill~

Thanks for notifying us of these issues. Our devs are aware of the issue and we will update this post when a release is available that fixes this issue. 

Thanks for your patience as we get this resolved!
Karen
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Hi~

The NOW vs. TODAY issue has been fixed in the Brooklyn release such that NOW is a timestamp of the current time and TODAY is midnight on the current day. 

Thanks!
Karen
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Karen,

I just updated my developer org. with Brooklyn Iteration 1.1 (Skuid 9.3).  I am still seeing the same problem where using the 'TODAY' option for a date/time field condition sets the time to '12:00:00AM'.  Do I need to do something beyond updating my version of Skuid?

I can confirm that manually editing the XML and replacing the 'TODAY' with 'NOW' still works to set the date and time with the current value.

Here is the page xml that I used to reproduce this issue:
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Task">    <models>
        <model id="Task" limit="1" query="false" createrowifnonefound="true" datasource="salesforce" sobject="Task" type="">
            <fields>
                <field id="Subject"/>
                <field id="ReminderDateTime"/>
                <field id="ActivityDate"/>
            </fields>
            <conditions>
                <condition type="fieldvalue" value="TODAY" enclosevalueinquotes="false" field="ActivityDate"/>
                <condition type="fieldvalue" value="TODAY" enclosevalueinquotes="false" field="ReminderDateTime"/>
            </conditions>
            <actions/>
        </model>
    </models>
    <components>
        <pagetitle model="Task" uniqueid="sk-3zNrFm-91">
            <maintitle>
                <template>New {{Model.label}}</template>
            </maintitle>
            <subtitle>
                <template>{{Model.labelPlural}}</template>
            </subtitle>
            <actions>
                <action type="savecancel" afterCancel="/{{Model.KeyPrefix}}/o" afterSave="/{{Id}}" rollbackonanyerror="true"/>
            </actions>
        </pagetitle>
        <basicfieldeditor showsavecancel="false" showheader="true" model="Task" mode="edit" uniqueid="sk-3zNrFm-92">
            <columns>
                <column width="50%">
                    <sections>
                        <section title="Basics">
                            <fields>
                                <field id="Subject"/>
                            </fields>
                        </section>
                    </sections>
                </column>
                <column width="50%">
                    <sections>
                        <section title="Additional Info" collapsible="no">
                            <fields>
                                <field id="ReminderDateTime"/>
                                <field id="ActivityDate" valuehalign="" type=""/>
                            </fields>
                        </section>
                    </sections>
                </column>
            </columns>
        </basicfieldeditor>
    </components>
    <resources>
        <labels/>
        <css/>
        <javascript/>
    </resources>
    <styles>
        <styleitem type="background" bgtype="none"/>
    </styles>
</skuidpage>

Thanks,

Bill
Photo of Chandra V

Chandra V, Champion

  • 6,966 Points 5k badge 2x thumb
This is not the behavior I am seeing.

Rockaway with a field update action on a date/time field gives me this console error:

"Visualforce Remoting Exception: Invalid integer: " Object { statusCode: 400, type: "exception", tid: 3, ref: false, action: "skuid.RemotingStubs", method: "save", message: "Invalid integer: ", where: "", data: Array[1], vfTx: true, 2 more... }



Brooklyn (9.3) doesn't have NOW in the choices, so I have to pick Today again.


It doesn't throw an error, but sets the time to midnight.


So, can NOW be added to the field update options in Brooklyn, and can Rockaway be fixed so our production orgs will be working?
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Hi Skuid Community~

Thank you for your patience as we addressed this bug. This issue has been resolved in the
Brooklyn Update 1 which is now available from the Skuid Releases page.

As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade.

Thanks!
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
This is the difference between TODAY and NOW:



Today will go to 12:00AM
Now will do the current time.
(Edited)
Photo of Pete Bennett

Pete Bennett

  • 140 Points 100 badge 2x thumb
I have updated my XML from TODAY to NOW and it is still returning (to Salesforce) 12:00 AM rather than the current time.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
I'd highly recommend changing it declaratively rather than just in the XML. Rarely is it best to go straight to the XML. Some functions do more than just change the value name.
Photo of Pete Bennett

Pete Bennett

  • 140 Points 100 badge 2x thumb
I actually have two different pages of the same build (cloned) and have made changes declaratively in one and XML in the other. In both cases, I have had the same result.
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
Can you share the XML on a simple reproduction page? I'd love to see what you're doing. Preferably on standard objects