Hello,
Is there any way to access the complete script code in PrimalForm ? I know you can access parts of the script in the script tab but it seems you can only access certain parts. If you export the script to a ps1, you can see the complete script but then you cant reopen it and access the form designer...
I did a form and need to add script parameters. I cant do it right now unless i export to a ps1, bu then if i ever need to change something in the form i'll have to manually edit it in the code or start from scratch.
Any help ?
Thanks
Doom969
Access Script
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Access Script
Generally there should be no need to modify the generated code. Specifically since changes to that code would not be preserved anyway.
If you need to initialize any form fields this should be done in the load event handler of the specific form.
If you can be more specific on what you would need to change we can look closer into it.
If you need to initialize any form fields this should be done in the load event handler of the specific form.
If you can be more specific on what you would need to change we can look closer into it.
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Access Script
Hello and thank you for your answer.
Like I said, i want to declare script parameters, so i'd need to access the first lines of the actual script. Lets say for example the script would have 2 exec modes : "./script config" and ./script execute".
Also, on an unrelated note, is there a way in the designer to design a 2nd form for the script ? Lets say i have a button to browse server and when i click on it i want to open a new form to check options and select the server and then click save and return to the main form with the data.
Thanks a lot
Doom969
Like I said, i want to declare script parameters, so i'd need to access the first lines of the actual script. Lets say for example the script would have 2 exec modes : "./script config" and ./script execute".
Also, on an unrelated note, is there a way in the designer to design a 2nd form for the script ? Lets say i have a button to browse server and when i click on it i want to open a new form to check options and select the server and then click save and return to the main form with the data.
Thanks a lot
Doom969
Access Script
I recommend creating a function with the params you need and calling it from the OnLoadForm Event (double click on Form in designer) and store the results into (script scope) variables.
As for the multiple forms, it
As for the multiple forms, it
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Access Script
A better alternative would be to use the Read-Host command, that way you needn't create a function to prompt for parameters.
David
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Access Script
Yeah, that doesn't really work for me because i wanted to have a script parameter named "execute" which would run the script unattended, reading value from the registry.
so if the script runs unattended i can prompt a user for the execute mode.
thanks
so if the script runs unattended i can prompt a user for the execute mode.
thanks