Page 2 of 12
Is it possible to have the same button run both a create service and an update service?
Posted: Mon Dec 01, 2014 5:26 pm
by Ellen Schlechter
Ok so got that changed back to _id. Now where should I put this code?
var id= data.length 0;
if(id){
check_update.execute();
}
else{
checkbox_create.execute();
};
Is it possible to have the same button run both a create service and an update service?
Posted: Mon Dec 01, 2014 7:07 pm
by Evgene Karachevtsev
Ellen,
1) Instead of pre{"userid": "hereIsYourUserIdYouWantToTest"}/pre
please use
pre{"_id": "hereIsYourUserIdYouWantToTest"}/pre
where _id - column in Database, you can open it and see all columns
2)
prevar id= data.length 0;
if(id){
check_update.execute();
}
else{
checkbox_create.execute();
};/pre
It doesn't matter how you name you variable - username or id, if it doesn't get value. You should check whether you have created any users or not .
If yes, then data.length will be greater then 0, that means that you can update it.
If not, then you should call creation service.
We would call it 'isCreated': so final
prevar isCreated = data.length 0; // this expression will return true or false
if (isCreated) {
check_update.execute();
} else {
checkbox_create.execute();
};/pre
Is it possible to have the same button run both a create service and an update service?
Posted: Tue Dec 02, 2014 2:28 am
by Ellen Schlechter
I made those changes but I'm having trouble connecting to the database to log in. The tester will open up the first page but load forever when I try to sign in.
Is it possible to have the same button run both a create service and an update service?
Posted: Tue Dec 02, 2014 5:36 am
by Yurii Orishchuk
Hi Ellen,
You need to debug your app.
Please read more about it here: http://devcenter.appery.io/documentat...
Regards.
Is it possible to have the same button run both a create service and an update service?
Posted: Tue Dec 02, 2014 9:24 am
by Egor Kotov6832188
1) instead of {"userid": "hereIsYourUserIdYouWantToTest"}
{"_id": "hereIsYourUserIdYouWantToTest"}
_id - column in Database, you can open it and see all columns
2)
var id= data.length 0;
if(id){
check_update.execute();
}
else{
checkbox_create.execute();
};
doesn't matter how you are name you variable username or id, if it doesn't get value
Is it possible to have the same button run both a create service and an update service?
Posted: Tue Dec 02, 2014 2:18 pm
by Ellen Schlechter
This is what I get. I don't know how this could've happened because I didn't change anything.
Is it possible to have the same button run both a create service and an update service?
Posted: Tue Dec 02, 2014 4:16 pm
by Evgene Karachevtsev
Hello Ellen,
Unfortunately there was a mistake in login success. Please show us screen shots for your login service success event.
Is it possible to have the same button run both a create service and an update service?
Posted: Tue Dec 02, 2014 6:41 pm
by Ellen Schlechter
Is it possible to have the same button run both a create service and an update service?
Posted: Tue Dec 02, 2014 9:44 pm
by Evgene Karachevtsev
Ellen,
Please clarify, what actions do you have on click event ?
Could you please navigate to design and take a screenshot of your button that invokes login service?
Is it possible to have the same button run both a create service and an update service?
Posted: Wed Dec 03, 2014 1:57 am
by Ellen Schlechter
I get the same issue when I click both of these buttons.