Test the current value of autoSysFields for a GlideRecord

James Fricker
Tera Guru

Anyone know if there is a way to test the current set value for autoSysFields on a GlideRecord? I want to debug an issue where a lot of BRs are running and somewhere autoSysFields is being set to false. I would like to do something similar to current.getAutoSysFields(). There is obviously a way to set this value, but I would like a way to read/get this value. Any ideas?

3 REPLIES 3

Simon Christens
Kilo Sage

Hi,

There is no methods to check it from a GlideRecord perspective as autoSysFields are typiccaly directly in the GR or in a BR, script include etc.
What you can do is:
Search for autoSysFields across different script types, BRs, script includes etc.
Else - if you can reproduce it from a GR or something, you can add a BR with current.autoSysFields(true) in a BR - order 100
See what happens, and if the fields are not set - then change the order to 1000, etc etc.

Once the fields gets set then you know theres something going on between order x and y.

 

You can also debug Business rules and create a record manually and go through the debugger 1 by 1.

This is a pain to troubleshoot and also the reason why autoSysFields, setWorkflow etc should be used with maximum caution.


@Simon Christens wrote:

There is no methods to check it from a GlideRecord perspective as autoSysFields are typiccaly directly in the GR or in a BR, script include etc.


thanks for your response, but I don't think this is a valid reason for why the method does not exist.

Hi again,

If you want a new feature then the Idea portal is probably a better place to put it.

https://support.servicenow.com/ideas?id=ideas_list&sysparm_module_id=enhancement_requests

 

You were asking if there was a way today which there isnt.

The same goes for setWorkflow