Skip to content

feat: add check for dictionary reference to sys_choice #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ca8467c41b9abc10ce0f62c3b24bcbaa/checksum.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
GMk-wMVtcl0e4HaeuZQZANxo2HAMeWyfhL8rbFLl_woCVyXOjsXdR7O1LSNRPaNARvxgRvjRsKeUMqXi-LPK4EoClDxNqk3Wx6qpPBGYVmhF9S7jsLROWoO5Rj1jiSisMbIsOVFuPN_ts_kAcUOlpwRSywuUD0Go7N2jHUFGg45f63KMtuZQRGtfAWwxSNNpZ9gtoq4JYulVrcmKdf_bKDyX1bSlzCzeXiL8ezaAI_l2Zj2hHdxsqF5hUEZLNFugquKGb_fR7WLoPsz2a8dJejAFgKLGI_Foz1ZekVncgM8k0Kbx13zj8ZYdn5BVnKE6gLQL12k2cr6Xr6ohpUJrLHpEdBaLri5zcAhQo35qtifNeIzKxZrfkoG72CJ2rgXkbjXwZjxVbQtwN1beAznnjjsw3nmQ7DyR3ytpRq_8X1nTg9NZ7qwmp8iYFEGm3A9vaZ2Gan1bgkcvFG5Kne80TqOTh2ev1oTZ1YI1xKYa7fQutdvMPSt-MEr5oj8Eu3uxtn0RVcKVMXOEh5WSDEBB69BmLGm1GIggD9gpCY6-a3_tvQ8Eb5CycVyH02LWYkgZJJOhB0ueIUo-_ldLl7BmTynkXFF0zouPxPQdKYb5jNfzXRi5p-okzqjdDsHP5XnV8ZnyEs_xdvSQHTHCnr7-AxjdnvzPtCTKH5mFzbLhID4
CiJ15NYBQlN98r5DlixaQIenUXX1VhYfhj3Viqimn6xnWLRjm49eemoXHGUOks40yE_KLBqmaWSeV7OWtVNzeOh9-y1LiYIK1vybPlCkm7Vs17cPZilSdJm90QP6eYbjuA2REbx6CenCuljifa_GhgrTQQQTXhfLrK4AITqwSONkcpSIq_JtLnGAQ5LxsEDZVwVRiosBg6ub4RhGBA_Ty3QB1c8QTDX5jMJ0w5v26VVfKclro6vthJBcfD7zKGT2O4dChhUM1CqmvzAeXTXxnQ-ntin_vJQNdqJOcZBeadAqgdq7_wGAZ5K89oTnIEG8wIi-TtNYo6iETGMYNKNZFfnXdFoqYCs7eLzZwzAx01yNQuixM8q29qc-UpMDfeVSOd-0rTgZTfQqHwkv3NgRqf6iJOFD_M8LSftCrO03UJb9UIzExafd6uwgGej8knhd3WlC9L0WyE9jpvLnBilYuuu2dv1cubkoK4J8Nyy8gWo8AY25xbvex6elPi0be9ynkQDFNtOnTMZRSBKWqHTZxM6N5VA8E3B5ZCB2zjgp6MQMAu7l0EoXfA5jkZG47xuBIbmYZYB45JRQwS0pWqdHWF6Y1D83eFIoFQ6FyYBcbJYBEDN8k3juc1IACIdH6rl9JWBRK6mr0PhujD-MKedCLbvL2OVLm6EAQTPnQMnjyo0
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
<scan_table_check action="INSERT_OR_UPDATE">
<active>true</active>
<advanced>false</advanced>
<category>upgradability</category>
<conditions table="sys_dictionary">internal_type=reference^reference=sys_choice^EQ<item display_table="sys_glide_object" display_value="Reference" endquery="false" field="internal_type" goto="false" newquery="false" operator="=" or="false" value="reference"/>
<item endquery="false" field="reference" goto="false" newquery="false" operator="=" or="false" value="sys_choice"/>
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
</conditions>
<description>The Choice table should not be used as the reference table for a Reference type field. Reference fields store the sys_id of the corresponding record in the reference table and show the specified display value. For example: the caller_id field stores the sys_id of a record from the user table and displays the corresponding name value. This presents a problem when using the sys_choice table, because existing records are deleted and replaced when choices are modified. This causes a new sys_id to be generated for each record in the choice list. So the sys_id stored in the Reference field is no longer a valid value and the reference is broken.</description>
<documentation_url>https://support.servicenow.com/kb?id=kb_article_view&amp;sysparm_article=KB0813643</documentation_url>
<finding_type>scan_finding</finding_type>
<name>Do not reference sys_choice table</name>
<priority>3</priority>
<resolution_details/>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function (engine) {

// Add your code here

})(engine);]]></script>
<short_description>Do not reference sys_choice table</short_description>
<sys_class_name>scan_table_check</sys_class_name>
<sys_created_by>ronald.karim</sys_created_by>
<sys_created_on>2024-10-04 19:35:57</sys_created_on>
<sys_id>6b1a4ee9c34d9210193f37cc0501312e</sys_id>
<sys_mod_count>0</sys_mod_count>
<sys_name>Do not reference sys_choice table</sys_name>
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
<sys_policy/>
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
<sys_update_name>scan_table_check_6b1a4ee9c34d9210193f37cc0501312e</sys_update_name>
<sys_updated_by>ronald.karim</sys_updated_by>
<sys_updated_on>2024-10-04 19:35:57</sys_updated_on>
<table>sys_dictionary</table>
<use_manifest>false</use_manifest>
</scan_table_check>
<sys_translated_text action="delete_multiple" query="documentkey=6b1a4ee9c34d9210193f37cc0501312e"/>
</record_update>
Loading