Script Error - Android only: not null constraint failed tbl_flex_content2.ownerUUID

364 views
Skip to first unread message

somm...@gmail.com

unread,
Jun 13, 2021, 8:01:18 AM6/13/21
to mementodatabase
Hi,

I am getting a toast error message when running this trigger script on insert (but the actions are done) :

var anilla = entry().field("Anilla");
var propio = entry().field("Anillamiento propio");
var ristras = libByName("Ristras").entries();
var entries = lib().entries();

// Verify uniqueness
var unique = true;                                 // Presuming, initially
for (var ent = 0; ent < entries.length; ent++) {   // Loop through all entries
    if (entries[ent].field("Anilla") == anilla) // If there is ever a match,
        unique = false;                            // Remember it
}
 
if (!unique) { // If not unique,
    cancel(); // Disallow the save
    message("Ya existe un individuo en la base de datos con la misma anilla ");  // Tell the user
}

var validado = !propio; 
if(propio){
for (var ent = 0; ent < ristras.length; ent++) {   // Loop through all entries
    if (ristras[ent].field("Anilla primera") <= anilla &&
        ristras[ent].field("Anilla Última") >= anilla){ // If there is ever a match, link to it
        validado = true;
message("Anilla de la ristra " + ristras[ent].field("Anilla primera") + "-" +  ristras[ent].field("Anilla Última"));
entry().link("Ristra", ristras[ent]);
break;
        } 
    }
}

if(!validado){
cancel();
message("Es un anillamiento propio, pero la anilla no aparece en ninguna ristra");
}

The error message is launched on line 28: 

entry().link("Ristra", ristras[ent]);

It says:

Script error: Wrapped android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: tbl_flex_content2.ownerUUID (code 1299 SQLITE_CONSTRAINT_NOTNULL[1299])(VerificarAnillaOnInsert.js#28)

The error is only launched in Android.

I have the lastest version of both Android and Desktop Memento Database.


somm...@gmail.com

unread,
Mar 3, 2022, 1:01:59 PM3/3/22
to mementodatabase
This error is still appearing in the newer versions.
It appears always when using the entry().link function. Do you have any idea what can be causing it?
Thanks

Er Mo

unread,
Mar 3, 2022, 1:20:02 PM3/3/22
to mementodatabase
Hallo
Tritt der Fehlen nur in der Mobil Version auf , oder auch in der PC Version

Hello
Does the error only occur in the mobile version or in the PC version as well?

Ernst

somm...@gmail.com

unread,
Mar 4, 2022, 4:04:20 AM3/4/22
to mementodatabase
Hi, Ernst.
Only in mobile version.
Thanks

Bill Crews

unread,
Mar 4, 2022, 8:39:13 AM3/4/22
to somm...@gmail.com, mementodatabase
It sounds like a support issue to me, but before contacting them, maybe it would be worthwhile to put a message() statement before line 28 like the following...

    message("ristras[ent]" + " = |" + ristras[ent] + "|");

It probably just says |Object entry|, but maybe it'll give more information as well.

Is it the last entry or the first? That might be helpful for them to know.

Sending your script, these answers, Android or iOS, and a link to your database with permissions that let them access everything to sup...@MementoDatabase.com should be enough for them to determine the error.


--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/8d0a9d30-7584-4aac-aa19-8b8643b7b03an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages