TheBigEye Posted December 16, 2006 Posted December 16, 2006 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??? Thanks
Ender Posted December 16, 2006 Posted December 16, 2006 No, parameters sent to a script persist even in Find Mode. There must be something else going on.
Genx Posted December 16, 2006 Posted December 16, 2006 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)?
TheBigEye Posted December 19, 2006 Author Posted December 19, 2006 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
Ender Posted December 19, 2006 Posted December 19, 2006 It's hard to say what's wrong without seeing it. Maybe you haven't quoted the parameters correctly. Anyway, why don't post the script for us to look at.
Genx Posted December 19, 2006 Posted December 19, 2006 (edited) 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 December 19, 2006 by Guest
TheBigEye Posted December 21, 2006 Author Posted December 21, 2006 (edited) 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 December 21, 2006 by Guest
Ender Posted December 21, 2006 Posted December 21, 2006 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 & """
TheBigEye Posted December 26, 2006 Author Posted December 26, 2006 Thank you Ender you are totally right i fixed it and it works perfect. Thanks to all who made a reply to this thread
Recommended Posts
This topic is 6544 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 accountSign in
Already have an account? Sign in here.
Sign In Now