Jump to content
Server Maintenance This Week. ×

Script Parameters


This topic is 6330 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi to all you there

I have a little problem and i hope you can help me i have a script with a parameter but when i enter find mode inside the script that parameter simply disappears, is that normal???

Are you SURE that's what's happening? Have you tried opening up the data viewer while in your script and just using Get(ScriptParameter)?

Link to comment
Share on other sites

i´ve cheked that and you are right the script parameter is there, but i am using a custom function called GetParam (paramName) like this

Evaluate ( "Let ([" & Get(ScriptParameter) & "]; " & paramName & ")" )

in my script i have to look for some records in a layout from another table, and when i change to that layout the GetParam function returns nothing, but the Get (ScriptParameter) works.

I hope you understand my explanation, and can help me, i cant find a solution for this.

Thanks

Link to comment
Share on other sites

It sounds like there's something wrong with the custom function.. but Ender's right, post the script (and double check the custom function code you used and that it's what you actually need).

I'll often pass multiple parameters but then just parse them out into variables... e.g.

GetValue(Substitute( Get(ScriptParameter) ; "|" ; "¶" ) ; 3)

Will retrieve "Likes" in the parameter list "John|Mayer|Likes|Fish"

You can just as easily make the above a CF as well and just call it getparam2( paramNum ) where paramNum in this case would be 3

Edited by Guest
Link to comment
Share on other sites

Hi all!!

This is my script parameter:

"idTrabajador = Trabajadores::idTrabajador; TipoMov = Trabajadores::TipoMov; fechaMov = Trabajadores::FechaMov; idObra = Trabajadores::idObra; salario = Trabajadores::Salario; TipoTrabajador = Trabajadores::TipoTrabajador; causaBaja = Trabajadores::CausaBaja"

My script:

1.- Set Variable [$idT; Value:GetParam("idTrabajador")]

2.- Go To Layout ["MovimientosLista"(Movimientos)]

3.- Enter Find Mode []

4.- SetField [Movimientos::idTrabajador;$idT]

5.- Perform Find []

Using script debug:

In Line 1 everything is working fine, i get the data i expect;

In line 2 all data i get is wrong, and that layout has data form a diferent table, so maybe here is the problem;

in Line 3 i don´t get any data, but get (ScriptParameter) is ok;

There must be something i´m doing wrong but i don´t know what is it.

Thanks, again

Edited by Guest
Link to comment
Share on other sites

I think the problem is with your parameter's syntax. The values must be evaluated in the parameter, like this:

"idTrabajador = " & Trabajadores::idTrabajador & "; TipoMov = " & Trabajadores::TipoMov & "; fechaMov = " & Trabajadores::FechaMov & "; idObra = " & Trabajadores::idObra & "; salario = " & Trabajadores::Salario & "; TipoTrabajador = " & Trabajadores::TipoTrabaja dor & "; causaBaja = " & Trabajadores::CausaBaja

Also, if any of those are text, you'll need to add quotes around their values, like this:

"param = "" & table::field & """

Link to comment
Share on other sites

This topic is 6330 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.