Code Monkey home page Code Monkey logo

servicenow-efficientgliderecord's People

Contributors

thisnameissoclever avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

servicenow-efficientgliderecord's Issues

Assume sys_id when no fields are given

Problem

When I just need to check the existence of a record with hasNext() I don't really need any fields returned. Without adding any field, superfluously, I will get an error that "No fields were specified to retrieve."

Possible solution

When there's no .addField() specified, assume that the sys_id should be returned. I believe this is how GlideQuery works.

Default Sorting

First of all - thanks for this library, landed here by chance after googling for something else, but certainly appreciating it a lot!

I wonder if I'm missing something, but doing orderBy("fieldName") seems to use alphabetical search by default, I could not find a way to sort numerically without pushing to an array and sorting myself, which is no biggy, but maybe there is a better way to be doing this...

In the example below, the u_priority field is an integer, The same happens when using the order field

// default order by is alphabetical, no good on numbers! (e.g they come out as 1,10,11,2,3,30,4,5 etc)
// Create an array, add the eGR values to it as objects, and then sort it numerically.
var priorities = [];
while (eGR.next()) {
  priorities.push({
    val: eGR.getValue("u_priority"),
    label: eGR.getDisplayValue("u_priority"),
  });
}
priorities.sort(function (a, b) {
  return a.val - b.val;
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.