Page 1 of 1

How to stop duplicates when invoking a list service?

Posted: Mon Dec 08, 2014 3:19 pm
by Xavier U

I had created a "favorites" page of sorts. Users will click the favorite button to invoke a "create service" to add a prayer id to a "list service."
Image

The "list service" is then loaded onto the "favorites" page.
Image

The only issue I am having with the functioning of the "create service" is that the favorite button can be clicked to add the prayer to the favorites page multiple times.
Image

How can I ensure that the "favorites" page will not have duplicate prayers?

Here is a public link to my test app: http://appery.io/app/mobile-frame?src...


How to stop duplicates when invoking a list service?

Posted: Mon Dec 08, 2014 9:37 pm
by Alena Prykhodko

Hello,

You can add check whether there is such record, if no - then invoke service with JavaScript:

preserviceInstanceName.execute({});/pre

where serviceInstanceName - service name