Hexagon Geospatial
MENU

M.App Enterprise

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Contributor
Posts: 42
Registered: ‎10-10-2015
Accepted Solution

Timestamp fields problem in Mobile App

Hi everyone, when create a mobile App in M.App Enterprise with two timestamp fields in a Form, Mobile App save the same new date and time to both fields, even with NO manually modifying the date in editing, the App updates both dates with actual save date.

 

When datetime field is visualized in the Form, the App replace/ignore the date in the database and put a new date.

 

I removed the option "RevisionField" for test, and the behavior is the same.

 

Thanks for advance

Staff
Posts: 19
Registered: ‎10-29-2018

Re: Timestamp fields problem in Mobile App

Hi,

 

if you switch the field type from Timestamp to DateTime it should behave as you described:

 

<Field Name="datefield" Type="DateTime" />
 
If you want to set the timestamps automatically on save you can do it like in the following sample:
 
<SaveShellAction.BeforeScript>
                if (Context.getValue('Id') == null) {
                    Context.setDateNow('CreationTime');
                    Context.setDateNow('LastUpdateTime');
                }
                else {
                    Context.setDateNow('LastUpdateTime');
                }
</SaveShellAction.BeforeScript>
 
 
Regards
Christian
 
Contributor
Posts: 42
Registered: ‎10-10-2015

Re: Timestamp fields problem in Mobile App

Thank you so much. 

 

Now i know, DateTime and Timestamp have different behavior. 

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Development Ticket through our Development Ticket Portal.