Skip to content

Commit 4006aa6

Browse files
committed
feat: add check for dictionary reference to sys_choice
Add Table check on Dictionary Entry [sys_dictionary], where Type is Reference and Reference is Choice [sys_choice] Resolves #108
1 parent 7a30a9e commit 4006aa6

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
GMk-wMVtcl0e4HaeuZQZANxo2HAMeWyfhL8rbFLl_woCVyXOjsXdR7O1LSNRPaNARvxgRvjRsKeUMqXi-LPK4EoClDxNqk3Wx6qpPBGYVmhF9S7jsLROWoO5Rj1jiSisMbIsOVFuPN_ts_kAcUOlpwRSywuUD0Go7N2jHUFGg45f63KMtuZQRGtfAWwxSNNpZ9gtoq4JYulVrcmKdf_bKDyX1bSlzCzeXiL8ezaAI_l2Zj2hHdxsqF5hUEZLNFugquKGb_fR7WLoPsz2a8dJejAFgKLGI_Foz1ZekVncgM8k0Kbx13zj8ZYdn5BVnKE6gLQL12k2cr6Xr6ohpUJrLHpEdBaLri5zcAhQo35qtifNeIzKxZrfkoG72CJ2rgXkbjXwZjxVbQtwN1beAznnjjsw3nmQ7DyR3ytpRq_8X1nTg9NZ7qwmp8iYFEGm3A9vaZ2Gan1bgkcvFG5Kne80TqOTh2ev1oTZ1YI1xKYa7fQutdvMPSt-MEr5oj8Eu3uxtn0RVcKVMXOEh5WSDEBB69BmLGm1GIggD9gpCY6-a3_tvQ8Eb5CycVyH02LWYkgZJJOhB0ueIUo-_ldLl7BmTynkXFF0zouPxPQdKYb5jNfzXRi5p-okzqjdDsHP5XnV8ZnyEs_xdvSQHTHCnr7-AxjdnvzPtCTKH5mFzbLhID4
1+
CiJ15NYBQlN98r5DlixaQIenUXX1VhYfhj3Viqimn6xnWLRjm49eemoXHGUOks40yE_KLBqmaWSeV7OWtVNzeOh9-y1LiYIK1vybPlCkm7Vs17cPZilSdJm90QP6eYbjuA2REbx6CenCuljifa_GhgrTQQQTXhfLrK4AITqwSONkcpSIq_JtLnGAQ5LxsEDZVwVRiosBg6ub4RhGBA_Ty3QB1c8QTDX5jMJ0w5v26VVfKclro6vthJBcfD7zKGT2O4dChhUM1CqmvzAeXTXxnQ-ntin_vJQNdqJOcZBeadAqgdq7_wGAZ5K89oTnIEG8wIi-TtNYo6iETGMYNKNZFfnXdFoqYCs7eLzZwzAx01yNQuixM8q29qc-UpMDfeVSOd-0rTgZTfQqHwkv3NgRqf6iJOFD_M8LSftCrO03UJb9UIzExafd6uwgGej8knhd3WlC9L0WyE9jpvLnBilYuuu2dv1cubkoK4J8Nyy8gWo8AY25xbvex6elPi0be9ynkQDFNtOnTMZRSBKWqHTZxM6N5VA8E3B5ZCB2zjgp6MQMAu7l0EoXfA5jkZG47xuBIbmYZYB45JRQwS0pWqdHWF6Y1D83eFIoFQ6FyYBcbJYBEDN8k3juc1IACIdH6rl9JWBRK6mr0PhujD-MKedCLbvL2OVLm6EAQTPnQMnjyo0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_table_check">
2+
<scan_table_check action="INSERT_OR_UPDATE">
3+
<active>true</active>
4+
<advanced>false</advanced>
5+
<category>upgradability</category>
6+
<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"/>
7+
<item endquery="false" field="reference" goto="false" newquery="false" operator="=" or="false" value="sys_choice"/>
8+
<item endquery="true" field="" goto="false" newquery="false" operator="=" or="false" value=""/>
9+
</conditions>
10+
<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>
11+
<documentation_url>https://support.servicenow.com/kb?id=kb_article_view&amp;sysparm_article=KB0813643</documentation_url>
12+
<finding_type>scan_finding</finding_type>
13+
<name>Do not reference sys_choice table</name>
14+
<priority>3</priority>
15+
<resolution_details/>
16+
<run_condition/>
17+
<score_max>100</score_max>
18+
<score_min>0</score_min>
19+
<score_scale>1</score_scale>
20+
<script><![CDATA[(function (engine) {
21+
22+
// Add your code here
23+
24+
})(engine);]]></script>
25+
<short_description>Do not reference sys_choice table</short_description>
26+
<sys_class_name>scan_table_check</sys_class_name>
27+
<sys_created_by>ronald.karim</sys_created_by>
28+
<sys_created_on>2024-10-04 19:35:57</sys_created_on>
29+
<sys_id>6b1a4ee9c34d9210193f37cc0501312e</sys_id>
30+
<sys_mod_count>0</sys_mod_count>
31+
<sys_name>Do not reference sys_choice table</sys_name>
32+
<sys_package display_value="Example Instance Checks" source="x_appe_exa_checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_package>
33+
<sys_policy/>
34+
<sys_scope display_value="Example Instance Checks">ca8467c41b9abc10ce0f62c3b24bcbaa</sys_scope>
35+
<sys_update_name>scan_table_check_6b1a4ee9c34d9210193f37cc0501312e</sys_update_name>
36+
<sys_updated_by>ronald.karim</sys_updated_by>
37+
<sys_updated_on>2024-10-04 19:35:57</sys_updated_on>
38+
<table>sys_dictionary</table>
39+
<use_manifest>false</use_manifest>
40+
</scan_table_check>
41+
<sys_translated_text action="delete_multiple" query="documentkey=6b1a4ee9c34d9210193f37cc0501312e"/>
42+
</record_update>

0 commit comments

Comments
 (0)