Script include not working in filter condition

Damo Dharan
Giga Contributor

I have created a script include which is returning sysid from system properties table,the same method is i'm calling in custom created module in filter arguments. It is perfectly working for admin profile but when we create custom profile the filter condition not working as expected(filter condition value coming as empty) 

 

Please see attached snapshot for reference ,If you provide some suggestion it would be great.

P.S :  There is no custom role created for module and the module is in global scope and table(Risk Statement) which we are used in module is in grc:risk management scope.

1 ACCEPTED SOLUTION

I reviewed this a bit further and actually realized that the issue on my suggestion is that gs.getProperty doesn't work on client side and arguments is checked there.

I also reviewed your script include and I don't think there's an issue with the script, but it won't work with glideajax. Try making a normal script include and then check the "client callable" option there. You still can't use gs.getProperty, but at least your gliderecord query should work and return the correct value.

I also made sure that it doesn't matter where you have javascript set so you can use

&sysparm_fixed_query=document=javascript:new scriptinclude().function();

Let me know if tossing the glideajax out gets this working.

View solution in original post

12 REPLIES 12

Oh, seems like you're working on a scoped application? It might help if you use the scope name in the getProperty query.

So if my scope was called x_scope and property was testing.itcs
Then I'd try:

javascript:'&sysparm_fixed_query=document=' + gs.getProperty('x_scope.testing.itcs')


Also as I'm not testing these I don't actually know what these would be returning.
It might be a good idea to start with the basics for debugging.
So does for example this work if you take the value in the property and use it:

javascript:'&sysparm_fixed_query=document=' + 'propertyvaluehere'

If it does then proceed with trying to use the scope name in the query as well.
If it doesn't you need to figure out what is broken first and you can remove the javascript like so:

&sysparm_fixed_query=document=propertyvaluehere


You can also add the scope name in the script include to the commented part and see if that helps you get a value in your gs.log

Hi Joni,

             Thanks for the detailed response,the customized module in global scope so I am using the same scope for script include & system property.The below are the observations;

1.&sysparm_fixed_query=document=propertyvaluehere - when we hardcode the sysid which is perfectly working for admin& others profile.

2. &sysparm_fixed_query=document=' + gs.getProperty('testing.itcs') - its not returning any values in filter condition but when i tested through background script its was fine and returning value.

3. javascript:'&sysparm_fixed_query=document=' + gs.getProperty('testing.itcs') - Its not working and printing the  same message in filter condition and assuming it was not right way to pass it in filter arguments.

 4.javascript:'&sysparm_fixed_query=document=' + gs.getProperty('x_scope.testing.itcs') -  No need to pass scope since we have created system property in global scope.

  

 Please let me know if there are any other ways to do it.

I reviewed this a bit further and actually realized that the issue on my suggestion is that gs.getProperty doesn't work on client side and arguments is checked there.

I also reviewed your script include and I don't think there's an issue with the script, but it won't work with glideajax. Try making a normal script include and then check the "client callable" option there. You still can't use gs.getProperty, but at least your gliderecord query should work and return the correct value.

I also made sure that it doesn't matter where you have javascript set so you can use

&sysparm_fixed_query=document=javascript:new scriptinclude().function();

Let me know if tossing the glideajax out gets this working.

I have tried the above suggested way as well, it was working for admin profile but when we impersonate as some other profile again that filter condition coming as empty which I was mentioned in the issue description. very strange behavior.

 

 

 

Well that is strange.

Does your non admin user have access to the target table to actually see what you're trying to show them?

I made a test script include and called that in the arguments.

The script include queried system properties for my custom.property with a sys id of an incident for a roleless user.

When the user clicked the module they were properly moved to the list view and they were able to see the record normally, so this definitely should work.

I then changed the sys id in the property to an incident that the user did not have access to. The list view ended up showing as empty so looks like in your case the user just doesn't have proper access to see what you're trying to link to. Try going to the table directly with your user and seeing whether they can see the records like so or not.