Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

List Control condition scripts

lmbaxter
Kilo Explorer

Hi,

I am modifying a list control and within my Omit New Script, I want the list of the new roles that are currently set for the list control.

I want to avoid making a trip to the server to query the table just to get the value of the field when I am already in the form.

Is there a way to get the value of list controls new_roles field so I can use the values in my script in the Omit New condition field?

I have tried g_form, current, gs and countless other things.

Thanks,

Lisa

4 REPLIES 4

Mahira
Tera Guru

Hi,

Can you share what logic you intend to write in the Omit New condition field?


ssb
Tera Guru

I'm thinking you want to write a script (for Omit New condition) that checks the 'New Roles' for the current List Control before the page is generated?

So you're looking to write (effectively) a server side script to hide the 'new' button before the list is displayed?

So there will not be a g_form because it's server side, there won't be a current because you're not working on a record, and you won't be making a trip to the server, because your script will be running on the server.

... and that then begs the question of why you're writing a script to check at run time the value of the New Roles field, which is effectively static at runtime?


lmbaxter
Kilo Explorer

Thanks for the information. I have decided to use another approach.

To answer your last question, the way we are set up there is another variable in play in regards to the role, so I was wanting a way to get to the roles so that I could use them to loop through to make an additional check.

Thanks again.


lmbaxter
Kilo Explorer

Thanks for the information. I have decided to use another approach.

To answer your last question, the way we are set up there is another variable in play in regards to the role, so I was wanting a way to get to the roles so that I could use them to loop through to make an additional check.

Thanks again.