I would like to know the best practices for GlideScript practice.

kenken1
Tera Contributor
I study GlideScript now.

I just looked up how to do it, but I couldn't find a way to quickly check the output.
There are many steps before I can see the result, and it takes time to learn.

To make the practice more efficient, we want to review the output results more quickly and turn around feedback


For example, I would like to know if there is a mechanism in GlideRecord that allows me to quickly see the result of typing JavaScirpt on the command line.

1 ACCEPTED SOLUTION

Claude DAmico
Kilo Sage

I'm going to be very careful about this mention, but there is a Scripts - Background module where you can run code immediately and see the results of the code on the page displayed after running the code. This can be used in several ways including for practice as you are asking about. The careful part is knowing that anything you do using that module, including testing making a change, WILL take effect. I use this regularly in my PDI for simple script tests and checking outputs. I do not use this, unless I am sure about it, for deleting, adding, or modifying records.

 

After submitting the script to run, I check the output and click the back button on my browser to return to the script I was testing to copy into a different script I am developing or make changes to continue debugging/testing.

 

This is good for retrieving data and testing outputs in my opinion.

 

If you want to test UI scripting (client) in combination with GlideScript (server), you can do all the same using available UI script options (UI Scripts, Client Scripts, UI Pages, etc. AND in combination with Script Includes) If you have a PDI, you can do all of that without worry. If you don't, maybe work something out with your people about creating a sandbox section of a DEV/TEST instance where you can play with all the components that offer any kind of script functionality. Having a test table that you can modify to your heart's content and utilize all that functionality is great for what you want to do.

Claude E. D'Amico, III - CSA

View solution in original post

2 REPLIES 2

Claude DAmico
Kilo Sage

I'm going to be very careful about this mention, but there is a Scripts - Background module where you can run code immediately and see the results of the code on the page displayed after running the code. This can be used in several ways including for practice as you are asking about. The careful part is knowing that anything you do using that module, including testing making a change, WILL take effect. I use this regularly in my PDI for simple script tests and checking outputs. I do not use this, unless I am sure about it, for deleting, adding, or modifying records.

 

After submitting the script to run, I check the output and click the back button on my browser to return to the script I was testing to copy into a different script I am developing or make changes to continue debugging/testing.

 

This is good for retrieving data and testing outputs in my opinion.

 

If you want to test UI scripting (client) in combination with GlideScript (server), you can do all the same using available UI script options (UI Scripts, Client Scripts, UI Pages, etc. AND in combination with Script Includes) If you have a PDI, you can do all of that without worry. If you don't, maybe work something out with your people about creating a sandbox section of a DEV/TEST instance where you can play with all the components that offer any kind of script functionality. Having a test table that you can modify to your heart's content and utilize all that functionality is great for what you want to do.

Claude E. D'Amico, III - CSA

kenken1
Tera Contributor

This is very useful advice!
I have a development and testing environment, so I am able to get the desired results by testing there!
Thank you very much.