Page 7 of 12

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

Posted: Thu Dec 18, 2014 8:24 am
by Yurii Orishchuk

Hi Ellen,

Could not reproduce this problem in your app cause of another problem.

Take a look here: http://prntscr.com/5i0wpk/direct

Please fix this problem first.

Regards.


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

Posted: Thu Dec 18, 2014 2:07 pm
by Ellen Schlechter

There is something wrong with this line of code.

var isCreated = data.length 0; // this expression will return true or false

I do not know what exactly is wrong.


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

Posted: Fri Dec 19, 2014 3:09 am
by Ellen Schlechter

Could it be possible that this code messes with the read service and query part of the mapping? Also, how would it know where exactly data.length is supposed to find the length?

var isCreated = data.length 0; // this expression will return true or false
if (isCreated) {
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: Fri Dec 19, 2014 5:08 am
by Yurii Orishchuk

Hi Ellen,

This code has one predefined variable "data" and is should an array.

May be you have not this variable?

Use console.log to see what is there..

pre

console.log("data = ");
console.log(data);

if(!data)
data = [];

var isCreated = data.length 0; // this expression will return true or false
if (isCreated) {
check_update.execute();
} else {
checkbox_create.execute();
};

/pre

Regards.


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

Posted: Fri Dec 19, 2014 1:58 pm
by Ellen Schlechter

It just simply returns data = with nothing behind it.


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

Posted: Mon Dec 22, 2014 6:06 am
by Yurii Orishchuk

Hi Ellen,

This code does not returns anything.. This code invoke different services depends on some condition.

Regards.


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

Posted: Mon Dec 22, 2014 1:49 pm
by Ellen Schlechter

Sorry I meant in the console, all it says is data =


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

Posted: Tue Dec 23, 2014 5:09 am
by Ellen Schlechter

If there is nothing behind the = sign, where do I go from there?


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

Posted: Tue Dec 23, 2014 5:57 am
by Yurii Orishchuk

Hi Ellen,

If this code type empty message that means you have empty data.

So debug it to have correct value.

Regards.


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

Posted: Tue Dec 23, 2014 3:05 pm
by Ellen Schlechter

I think I need some sort of variable to say what isCreated actually is. How does it know where to search?