Skip to content
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ api.controller = function ($rootScope, $scope) {
### Provide alternate value when fetching Glide property
Recommendation to provide alternate/default value when calling gs.getProperty() to avoid errors if the property is not set.

### Using setValue()'s displayValue Parameter with Reference Fields
When using setValue() on a reference field, be sure to include the display value with the value (sys_id). If you set the value without the display value, ServiceNow does a synchronous Ajax call to retrieve the display value for the record you specified. This extra round trip to the server can leave you at risk of performance issues.

### Running Business Rules on Transform Maps
Running business rules during transform may cause the transform to take longer than expected, or cause the instance to slow down.Do not run items like business rules, workflows, approval engines, and so on during a transform unless you want all insert and update business rules, notifications, and workflows to run

Expand Down
2 changes: 1 addition & 1 deletion ca8467c41b9abc10ce0f62c3b24bcbaa/checksum.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
r4ZuX_Pi1kiBWA3uccoq6uRBy5jhyU7u2FWxZb2f3Ljn3XhaKUHx5gmeOg0xXarKLDSSUuu2ohefZAzWNoWneSzxr5Y4vQT1Env7MeNsLl0kj_G8SpHUwUVoPxt7fILrxdvRFHO53wQ1lrXgE50HG7sazqh9s1KgUEMYAyXLNktTH1J9tNg5V-7sL-I4U4ZUB4NfOLMYsNopUnApMA5Tup2Eh66FQ4srJDTBM_3rDMHtqLXBhnFjAPXcEr4h7Z6q3_dbloqAuiP7Lvq2IksKp0-cWND3Inh_g58QP3yhkhxngsNT0mV6b4Sf1-l3QR7JGbG8-S-KezXbuJab5rPdOPu7mJNzR6A8K0QzYu8FWPQtGkvvH-gmniqKk6NV4-RAR_x1pxdZSGPTXz3vLvk_HhS0kY9BMHpTeOcpoub9YNzc8m4yjtte8G7ceciXRN-5bRzwTyqkgKJB7JEn6D4SRFFOqDCmkYTWv3PZUp_sznMQ76nSassjdoCNCUW1o1XVUmmp3XiMp5bnefYAyfaEBTYkQkVNiLUZ3S3G6VF4uXq54PK26Nrj9NHwiv7dIYn3xPkU7BlHHFZpthr-zMDLejkwV89iGv_bqhn0F3uKnv4a_CJhXa5U4rfWQIwiDo27aheYcsNvqhQ6Sbb4wC2OYXTbdY7JsGUmpDiimevQ6nk
EwzwYi9oGVvBPFVVP4VvTH8iqkJk6zG-ugt1IQoWzimJwfCK41JFgpYBAyaYT9WYBgBmwJnQIukNiq2zOdAxDHmJun9N0Mpe6Q9Lp0vaj_pCeUgq2-o_QQLrSsmGtE-v7jCix_Je-lRKCEXfm_qaFmVsuZ_cCorZXg_Jh3Y8MQyxzRe_FSPPYBoORzY15gkeKONfUpUHG1secSFdVx5guLGl8khrY9sxTVpJlby1TzM5jA9HbeTqjVst4cv8OrbSppCCjRT7fdORqksNN_f4AbOW5UlGFQC4NnWuhGbOb6Wh5Jbuf2mAc3889aXO__tXaxarYujlHR-JAYnvFEtJB_W3kyfy1E6l-wvjPFPi0HD3jEA0YaHXUlypJ-U0EPfIs_W6zWnypB5ODwQ3ntGOr8eBbbNuqySIrJNCsciq5n8gT31eL71q_MDX6boGnIoOxDpwuSX7qr1AeQdW1H4X-7m1oVbnyPhzDLgbCL2kkXcoVhhZ4YjQ8JkcXNf81FekS1P-jmpZZmFPmixFUrNHbGWt3M28LRdxmk1MM_av-Dc94sH7Ic6tmcZwNScfjbVhzCHH3wI6DH8ewsC2ZTYQ17BaT4pNwPNTiMBGHHszEYIWy41DIoe-tLfgPyf8woq5LrQrkqLck3EVrvP6EXX12x0iop0F9V1J2KIY0SuEKFk
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?><record_update table="scan_linter_check">
<scan_linter_check action="INSERT_OR_UPDATE">
<active>true</active>
<category>performance</category>
<description>When using setValue() on a reference field, be sure to include the display value with the value (sys_id). If you set the value without the display value, ServiceNow does a synchronous Ajax call to retrieve the display value for the record you specified. This extra round trip to the server can leave you at risk of performance issues.</description>
<documentation_url>https://developer.servicenow.com/dev.do#!/guides/tokyo/now-platform/tpb-guide/client_scripting_technical_best_practices</documentation_url>
<finding_type>scan_finding</finding_type>
<name>Using setValue()'s displayValue Parameter with Reference Fields</name>
<priority>3</priority>
<resolution_details>Using the third parameter, where display name of the reference record can be passed.</resolution_details>
<run_condition/>
<score_max>100</score_max>
<score_min>0</score_min>
<score_scale>1</score_scale>
<script><![CDATA[(function(engine) {

engine.rootNode.visit(function(node) {
if (node.getTypeName() === "STRING") {
var text = node.toSource();

// looks for all occurrences of g_form.setvalue() and verifies it has all the relevant
// paramters, which includes display name to avoid the synchronous ajax call
var pattern = /g_form\.setValue\(([^,]*),([^,]*)\)/gm;
var regExp = new RegExp(pattern);
var matchFound = regExp.test(text);
if (matchFound){
engine.finding.incrementWithNode(node);
}
}
});

})(engine);]]></script>
<short_description>Using setValue()'s displayValue Parameter with Reference Fields</short_description>
<sys_class_name>scan_linter_check</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2023-10-13 13:18:39</sys_created_on>
<sys_id>85c352ae2f3db11002eb2ca62799b68e</sys_id>
<sys_mod_count>2</sys_mod_count>
<sys_name>Using setValue()'s displayValue Parameter with Reference Fields</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_linter_check_85c352ae2f3db11002eb2ca62799b68e</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2023-10-13 14:49:20</sys_updated_on>
</scan_linter_check>
</record_update>