$nuHash in BeforeSave

$nuHash in BeforeSave

Unread postby OLMGBG » Sun Feb 15, 2015 12:32 am

Hi all,
I'm experiencing nubuilderpro and I've got some issues with $nuHash while writing some validation code in BeforeSave section.
All I can see is that the array obtained from nuSubFormArray() seems to be empty... can't see what I'm doing wrong, hope you'll help....
I have a form named 'rf_user' in which I have a sub form 'ev_temps_subform'. the first column is a field names 'F_USERID'
the code :
$arr = nuSubformArray('ev_temps_subform');
for ($idx = 0 ; $idx < count($arr)-1 ;$idx++){
$v .= $idx+1 .' ' .$arr[$idx];
}
nuDisplayError('Tableau Element : '.$v.'---');
return;

gives this :
1 : 1 ev_temps_subform0001 2 ev_temps_subform0002....
the number of items seems to fit the number of lines of my subform.
but when I try to get one of the values with a code like this :
$arr = nuSubformArray('ev_temps_subform');
for ($idx = 0 ; $idx < count($arr)-1 ;$idx++){
$v1 .= $nuHash['ev_temp_subform0001F_USERID'];
// tried all the syntaxes I found evrywhere like $nuHash[$arr.idx.'F_USERID'] or $nuHash[$arr[idx]].'F_USERID] ....
}
nuDisplayError('Tableau Element : '.$v1.'---');
return;
I get something like that :
Tableau Element : ---

(Wampserver installation)
Thanks,
OLM.
OLMGBG
 
Posts: 7
Joined: Sun Feb 15, 2015 12:11 am

Re: $nuHash in BeforeSave

Unread postby admin » Mon Feb 16, 2015 8:26 am

OLM,

There was a bug but its fixed as of today.

So you can do a pull from github.

Steven
admin
Site Admin
 
Posts: 3406
Joined: Mon Jun 15, 2009 9:53 am
nuBuilder Version: 4.5

Re: $nuHash in BeforeSave

Unread postby OLMGBG » Mon Feb 16, 2015 7:22 pm

Thanks for your quick reply...
I've never been to Github, using this link to install...: https://www.nubuilder.net/downloads.php
Have you already written a sort of tuto to get updated files from Github ?
Have a nice day too.
OLMGBG
 
Posts: 7
Joined: Sun Feb 15, 2015 12:11 am

Re: $nuHash in BeforeSave

Unread postby admin » Fri Feb 20, 2015 1:35 pm

OLMGBG,

Does this help you?

https://www.nubuilder.net/downloads.php

Steven
admin
Site Admin
 
Posts: 3406
Joined: Mon Jun 15, 2009 9:53 am
nuBuilder Version: 4.5


Return to Custom Code

Who is online

Users browsing this forum: No registered users and 4 guests