Page 1 of 3

recording date and time on button click

Posted: Tue Jul 08, 2014 7:37 am
by graham street

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


recording date and time on button click

Posted: Tue Jul 08, 2014 8:33 am
by Kateryna Grynko

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


recording date and time on button click

Posted: Tue Jul 08, 2014 12:44 pm
by graham street

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


recording date and time on button click

Posted: Tue Jul 08, 2014 8:20 pm
by Alena Prykhodko

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.


recording date and time on button click

Posted: Wed Jul 09, 2014 6:24 am
by graham street

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


recording date and time on button click

Posted: Wed Jul 09, 2014 7:50 pm
by Evgene Karachevtsev

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


recording date and time on button click

Posted: Thu Jul 10, 2014 5:54 am
by graham street

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


recording date and time on button click

Posted: Thu Jul 10, 2014 1:58 pm
by Kateryna Grynko

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.


recording date and time on button click

Posted: Fri Jul 11, 2014 6:07 am
by graham street

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.


recording date and time on button click

Posted: Fri Jul 11, 2014 8:28 am
by Maryna Brodina

Hello!

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