Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Is it possible to have the same button run both a create service and an update service?

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();
};

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

Is it possible to have the same button run both a create service and an update service?

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

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Is it possible to have the same button run both a create service and an update service?

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Is it possible to have the same button run both a create service and an update service?

Hi Ellen,

You need to debug your app.

Please read more about it here: http://devcenter.appery.io/documentat...

Regards.

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

Is it possible to have the same button run both a create service and an update service?

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

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Is it possible to have the same button run both a create service and an update service?

This is what I get. I don't know how this could've happened because I didn't change anything.
Image

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

Is it possible to have the same button run both a create service and an update service?

Hello Ellen,

Unfortunately there was a mistake in login success. Please show us screen shots for your login service success event.

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

Is it possible to have the same button run both a create service and an update service?

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?

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Is it possible to have the same button run both a create service and an update service?

I get the same issue when I click both of these buttons. Image
Image

Return to “Issues”