Skip to content

Releases: thisnameissoclever/ServiceNow-EfficientGlideRecord

v1.0.4

11 Nov 20:26
Compare
Choose a tag to compare

v1.0.4

  • Updated query validation so that queries can now be performed even when no fields are specified.
    • In this case (when no fields are specified using .adddField()), only the sys_id will be returned as an accessible field.
  • The sys_id field will now always be returned, whether specified using .addField() or not.
  • Dot-walking is now supported when calling .addField(), .getValue(), and .getDisplayValue()!
    • To use this functionality, simply call .addField('some_reference_field.some_other_field', getDisplayValue).
    • To get the dot-walked field value after the query, use .getValue('some_reference_field.some_other_field').
    • To get the display value, use .getDisplayValue('some_reference_field.some_other_field').

v1.0.3

01 Nov 16:07
Compare
Choose a tag to compare

PLEASE SEE THIS PAGE FOR FULL API DOCUMENTATION

In the full article, you'll find API documentation, usage examples, upcoming features, and even a detailed performance comparison (showing that EfficientGlideRecord (EGR) reduces total execution time by somewhere between 77% and 93% over ServiceNow's out-of-box (OOB) client-side GlideRecord API class.

Installation instructions

To install and configure this application, follow these instructions:

  1. Download the attached XML (SNG-EfficientGlideRecord-v1.0.3.xml),
  2. Log into your ServiceNow instance as an administrator, and navigate to the System Update Sets > Retrieved Update Sets module from the application navigator.
  3. Scroll to the bottom of the Retrieved Update Sets list, and click on the Import Update Set from XML UI Action from the Related Links section.
  4. Select the XML file you downloaded in step 1 (SNG-EfficientGlideRecord-v1.0.3.xml), and import it into your instance.
  5. Navigate back to the Retrieved Update Sets table, and locate the Update Set you just imported (with the same name as the file, minus the file extension). Click on it to open the Update Set.
  6. If you have a Preview Update Set button, click it and allow the preview to complete.
  7. If there are no preview problems, click Commit Update Set. If there are any issues, resolve them.
    Note: If you're missing the "Stock" Service Portal theme, you may see a preview error relating to that file not being found. Go ahead and reject that one update, and then be sure to (as always) manually double-check that whatever theme(s) you are using on any of your Service Portals has the EfficientGlideRecordPortal UI Script added as a JS Include.
  8. Click the Commit Update Set button to deploy this tool to your environment.
  9. Make sure that whatever theme(s) you are using on any of your Service Portals has the EfficientGlideRecordPortal UI Script added as a JS Include.
    Note: Despite the fact that the portal version of the UI Script has the API Name "EfficientGlideRecordPortal", you would interact with it using new EfficientGlideRecord(tableName), exactly like you would when using the desktop version. The two have identical functionality, and the exact same scripts will work with each.
  10. Now, you can write client scripts using the EfficientGlideRecord class to perform server-side queries much more efficiently instead of GlideRecord (or manually creating GlideAjax interfaces)

Changelog

v1.0.3

  • Split this functionality into two separate UI Scripts to work around ServiceNow's weird and broken handling of JS Includes when two UI Scripts have the same name.
  • Portal behavior should now be much more stable. For real this time.

v1.0.2

  • Fixed an issue with scope binding specifically in Service Portal.
  • Added a JS Include to the default "Stock" Service Portal theme to include the minified version of EfficientGlideRecord. If you use a different theme for your Service Portal, please be sure to add a JS Include for the portal version of the EfficientGlideRecord UI Script to your theme.

v1.0.1

  • Added .getRowCount() method to get the number of rows returned from the server (limited by .setLimit() if specified).
  • Improved documentation and examples (in this article as well as in the JSDoc in the code).
  • Updated get(recordSysID) so you no longer have to call next() in the callback function (it should've been this way from the start; my bad).

v1.0.0

  • Initial public release