Page 1 of 1

Form Breadcrum and nuDisplayError

Posted: Tue Feb 24, 2015 5:24 pm
by OLMGBG
Hi,
I've experienced something new I don't understand at all :
I've a form in which I've a breadcrum, something like this :
SELECT 'Form no. : #RECORD_ID#'
I've written some code in the Before Save section,
......
// Si type = Projet, il faut un code projet
if ($nuHash[$arr[$idx].'F_TYPE'] == 'Projet'){
if ($nuHash[$arr[$idx].'F_PROJ'] == '') {
$Message .= 'Code Nature manquant ligne '.$idx.' ';
}
}
}
// Si on a une erreur ...
if ($Message != ''){
nuDisplayError($Message);
return;
}
....
While executing I get a message like Json parse failed.
Just adding a comment mark // before the nuDisplayError instruction prevents the Json message from coming (and of course my error message), deleting the BreadCrum and restoring the nuDisplayError also prevent the Json message from displaying, I get my error messag :)

I get the following lines in the php_error.log :

[24-Feb-2015 16:33:46 Europe/Paris] PHP Warning: Invalid argument supplied for foreach() in C:\wamp25\www\TMS\nuapi.php on line 1534
[24-Feb-2015 16:33:46 Europe/Paris] PHP Stack trace:
[24-Feb-2015 16:33:46 Europe/Paris] PHP 1. {main}() C:\wamp25\www\TMS\nuapi.php:0
[24-Feb-2015 16:33:46 Europe/Paris] PHP 2. nuGetEditForm() C:\wamp25\www\TMS\nuapi.php:140
[24-Feb-2015 16:33:46 Europe/Paris] PHP 3. nuGetBreadcrumb() C:\wamp25\www\TMS\nuapi.php:1491

Hope it'll help you.

Kind Regards,

Re: Form Breadcrum and nuDisplayError

Posted: Fri Feb 27, 2015 2:29 am
by admin
OLMGBG,

I don't understand what you are saying.

Steven

Re: Form Breadcrum and nuDisplayError

Posted: Sun Mar 01, 2015 9:17 am
by OLMGBG
Sorry for my English.... obviously not as good as i was expecting !
Il seems to be clear, when I have both a breadcrum and a nuDisplayError in the BeforeSave, (in the same form), I get the error message. Having just one on them prevents the error message from coming.
But if not clear enough tell me what you are misunderstanding.... if too complex never mind forget it I will work around, leaving the breadcrum.
Regards,
OM

Re: Form Breadcrum and nuDisplayError

Posted: Mon Mar 09, 2015 3:00 am
by admin
OM,

There is nothing wrong with your English, it is good but now you say..
when I have both a breadcrum and a nuDisplayError in the BeforeSave
I understand nuDisplayError is a function that can be used in Before Save, but breadcrum is not.

This is what I don't understand. Sorry.

Steven

Re: Form Breadcrum and nuDisplayError

Posted: Fri Mar 13, 2015 5:19 pm
by OLMGBG
Sorry I wasn't perfectly clear too.
the Breadcrum I was talking about is in the "All" tab of my form.
whatever I'm filling in the breadcrum cell causes the error message to raise when at the same time I've a nyDisplayError statement in the BeforeSave...
I know it's obviously bizarre.
Having this problem I've stopped using breadcrums.

Kind regards,
OLM

Re: Form Breadcrum and nuDisplayError

Posted: Mon Mar 16, 2015 11:04 pm
by admin
I still don't understand, maybe attach a screen shot.

Steven

Re: Form Breadcrum and nuDisplayError

Posted: Tue Apr 07, 2015 8:15 am
by lbug7575
I want to perform data validation and only allow unique combinations of two values in a table to be saved. I can achieve this in mysql by both setting a primary key on these two columns (Col1,col2) and add a unique index (col 1, col2). But then Nubuilder just stalls when Save is clicked. I know that NuBuilder can't use the db constraints but has to use its own validation/joins.

Re: Form Breadcrum and nuDisplayError

Posted: Fri Apr 24, 2015 2:01 am
by admin
lbug7575,

If nuBuilder "stalls" you probably have a bug in your code.

Steven