0

Doppelte Einträge finden

Hallo

Ist es möglich, dass ich beim erstellen eines Datensatz darauf hingewiesen werde, dass es diesen schon gibt?

zB: Ich gebe im Feld "Artikelnummer" den Wert 7329 ein. Es gibt aber in dieser Tabelle bereits einen Eintrag mit 7329. Dann müsste ich darauf hingewiesen werden, zB. ich kann den Datensatz nicht speichern oder ein Feld wird Farbig markiert oder etwas anderes. Wichtig ist einfach die Möglichkeit einen Hinweis auszugeben.

Danke und Gruss Adrian

5 replies

null
    • Phrank
    • 2 yrs ago
    • Reported - view

    das würde mich auch mal intessieren. generell den die datenbank nach ähnlichen oder doppelten einträgen durchsuchen. auch drai jahre später…

    • Ninox partner
    • RoSoft_Steven.1
    • 2 yrs ago
    • Reported - view
    • Phrank
    • 2 yrs ago
    • Reported - view

    thanks. will try

    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    Unfortunately, Ninox does not actulally enforce not saving a record if it is a a duplicate on a chosedn key field that you want as unique

    However I check for duplciate customer account codes.

    This is my script - I test it on entering new customers so that the account code is not duplicated!

    let a := upper(Custid);
    if cnt((select Customers)[upper(Custid) = a]) > 1 then
    styled("A/c Code is in use !", "red")
    end

    so you could add something like this

    Add a formula field to your form - then add a script to it 

    you will need to enter your table name wher the products are stored

    let a := 'Item nmber';
    if cnt((select your table name here)['Item number' = a]) > 1 then
    styled("A/c Code is in use !", "red")
    end

    record 1 - product item and code entered

    Screenshot 2021-08-07 at 17.57.58

     

    Entering Record 2 - Product number 2 but inadvertantly tring to give it the same code as product 1!

     

    Screenshot 2021-08-07 at 17.58.17

     

    Hope that helps

    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    also forgot to say I have set the formula to show only whne the condition is true!

    and they only way I could get it to work was to enter excatly the same scripnt into the 

    Display field only if - section

    So you need it it that and the Forumla section !

Content aside

  • 2 yrs agoLast active
  • 5Replies
  • 1844Views