graham street
Posts: 0
Joined: Thu Jul 03, 2014 11:08 am

recording date and time on button click

I have a page which shows an address at the top with 3 buttons under it.

  1. travelling to

  2. Arrived at

  3. Complete

    Is there a tutorial anywhere that will give me an idea of how to record the current date and time in my DB when each of the buttons are pressed.
    Thanks

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

recording date and time on button click

Hi Graham,

1) Add a field of date type to Database.
2) Create a Create service: http://devcenter.appery.io/documentat...
3) Run the following code for mapping of request parameter to date field:prereturn (new Date()).getTime();/pre

graham street
Posts: 0
Joined: Thu Jul 03, 2014 11:08 am

recording date and time on button click

thank you for your reply
I have a database col "travel_to" which is set to date
I have a "travel_to_create" service which is mapped as follows
travel_to button Text to travel_to database
userSessionToken to x-appery-session-token
address_id to x-appery-database-id
the js for travel_to on database side is set as per your script above
the travel_to button event is set to click invoke service "travel_to_create"
when I run the app nothing appears in the database....
any ideas? what am I missing or what have I done wrong

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

recording date and time on button click

Hello Graham,

Please show us console Network tab when you run the service http://devcenter.appery.io/documentat...
Also service mapping screen shots will help.

graham street
Posts: 0
Joined: Thu Jul 03, 2014 11:08 am

recording date and time on button click

Hi there here are the screen shots requested
network console scree shot
and
travel_to_create service mapping
also
here is a link to the app the username is Graham and the password is havant55
http://appery.io/app/mobile-frame?src... Image Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

recording date and time on button click

Hello Graham,

Could you please show us the exact service response. Select the service which returned an error (it is red) and then in the right window, select the tab Response

graham street
Posts: 0
Joined: Thu Jul 03, 2014 11:08 am

recording date and time on button click

Hi Evgene,
I have attached the screen shot you asked for it seems to be saying that my database does not exist, which is odd because I can see it on my screen. Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

recording date and time on button click

Hi Graham,

Probably you have really deleted this Database. Could you please check in a list of your databases (https://appery.io/database) what databases you have and which one is set up for this service.

graham street
Posts: 0
Joined: Thu Jul 03, 2014 11:08 am

recording date and time on button click

Hi Katya,
I only have one database, and it is there I can see it, the first page of the app lets me log in and read data from the database so it is definitely there. Also I am using the create service on the second page of the app to add an address and that works fine. I am tempted to scrap the entire thing and start from scratch but as it has taken me 2 weeks to get this far that does seem like a waste of time particularly if I get to this point again and get the same error. so I am not quite sure what to do next, I can't really afford to waste any more time with this as it is just taking far to long to get anything that works.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

recording date and time on button click

Hello!

Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a

Return to “Issues”