Page 1 of 1

Prevent Duplicate Records

Posted: Mon Mar 03, 2014 7:14 pm
by Bad Addy

Can you prevent duplicate records. I have looked at distinct, but that only allows one column. And I would need two. Plus the examples are for retrieving information ?


Prevent Duplicate Records

Posted: Mon Mar 03, 2014 8:20 pm
by Maryna Brodina

Hello!

Yes, distinct only allows one column. You can filter data in service results (on success service event) or do request through server code and filter data in server code.


Prevent Duplicate Records

Posted: Mon Mar 03, 2014 8:23 pm
by Bad Addy

Just seen a Webinar on Server Code. If I do anything on success, it will be to late, as I am creating a row, not collection from it. Just don't want the same two columns to be placed twice in the database.

Thanks though.


Prevent Duplicate Records

Posted: Mon Mar 03, 2014 8:31 pm
by Maryna Brodina

Then you need to use server code to implement this app logic.


Prevent Duplicate Records

Posted: Sun Nov 16, 2014 10:51 am
by Takis

An example please?


Prevent Duplicate Records

Posted: Tue Nov 18, 2014 2:28 am
by Yurii Orishchuk

Hi Panagiotis,

Here is a brief plan:

  1. On create item you should:

    1.1. Query db collection on the same value.
    1.2. If there is items (with same fields) - you return to user validation error.
    1.3. If there is not items (with same fields) - you create an item and tell user "OK".

    Regards.