Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Procedure: get value from FORM

Locked
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Procedure: get value from FORM

Unread post by ruiascensao »

Hi,

I'm building a "Procedure" and I'm using "$formValue" to get the value of the form field.
But it does not work. Any idea why?

Thank you for the support.
BR
Rui
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Procedure: get value from FORM

Unread post by massiws »

Rui,
from wiki:
$formValue
This is an array of the Variables from the selection Form, created prior to running an activity
.

In selection form you should have, for example, an object with "my_obj" in All tab > Field Name.
In your procedure code you should have:

Code: Select all

$value = $formValue['my_obj'];
Hope this helps,
Max
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: Procedure: get value from FORM

Unread post by zazzium »

Hi,
$formValue works in report Data Code.
In Procedure u have to pass values with runIt function
e.g. runIt("pcode","val1","val2","val3")

and catch the values in Procedure PHP Code
$var1 = "#runIt1#";
$var2 = "#runIt2#";
$var3 = "#runIt3#";

http://wiki.nubuilder.com/tiki-index.ph ... nIt_pCode_

zazzium
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Procedure: get value from FORM

Unread post by massiws »

Rui, zazzium is right: sorry I misunderstood what you wrote. :oops:
zazzium, thanks for correcting me.
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Procedure: get value from FORM

Unread post by ruiascensao »

Hi,

Thanks!
I have this procedure with a filed:
procedure_asset.jpg
procedure_asset.jpg (20.21 KiB) Viewed 8380 times
and I need to scan a asset tag (with a hand scanner with "return carriage").
After scan I need the the procedure to "run" (open the new window and close it when if finishes). The "Asset field" has then to be empty and ready to accept a new value.

Any advice?

Thank you.
BR
Rui
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: Procedure: get value from FORM

Unread post by zazzium »

Hi,

if u want a button, use "Extra Action Buttons" on the form.
add button title and "Javascript to run";

Code: Select all

runIt("procedureCode",$("#fieldName").val());
$("#fieldName").val(''); //clear the field for the next scan
where procedureCode is obviously procedure code and
$("#fieldName").val() fieldName is the fields name u need to pass to procedure.
pic:
http://prntscr.com/1m4f7y


in Procedure PHP Code:

Code: Select all

$var = '#runIt1#';

//do your stuff

echo "<html><body  onload='window.close()'></body></html>";
pic:
http://prntscr.com/1m4dk4


but u could activate the runIt() function automatically when the required field gets the value from the scanner with javascript.

hope it makes sense
zazzium
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Procedure: get value from FORM

Unread post by ruiascensao »

Hi,

Perfect!! Thanks, its works.
BR
Rui
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Procedure: get value from FORM

Unread post by massiws »

.
Locked