Skip to content

Conversation

@kumarinisha378
Copy link

Use this in client side like ui action get all active data from selected table.

use this in client side like ui action get all active data from selected table.
@WillemZeiler WillemZeiler self-requested a review September 30, 2025 18:44
@WillemZeiler WillemZeiler self-assigned this Sep 30, 2025
@WillemZeiler
Copy link

@kumarinisha378 thank you for your submission. I have started reviewing your code, however, from the description it is not clear to me what your intend of this code is. Can you please add more context?

Copy link

@WillemZeiler WillemZeiler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@earlduque is this still relevant? It is an open pull request, but not in the 3 main projects.

var dictionaryInfo = {};

// Initialize field counts
var gr = new GlideRecord(tableNames);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Kumarinisha378,
thank you for submitting this! Appreciate the effort and extend of this new file. Please note gr as variable name should be avoided. Can you use descriptive variable names instead?

var fields = gr.getFields();
for (var i = 0; i < fields.size(); i++) {
var fieldName = fields.get(i).getName();
fieldCounts[fieldName] = 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would combine this. Instead of gliderecord through all records initializing, then going over them in another (same query) on line 17-29, it would be better to iterate through each record once and set the fieldCounts. This requires less lines of code and impacts the performance less.

}

// Iterate through each record and count non-empty fields
gr = new GlideRecord(tableNames);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tableNames suggests it is plural, however, the code only accepts one table. Would be good to change the name. Additionally, provide a comment on the function and it's parameters. For example /** Returns x to the n-th power. @param {number} x The number, @param {number} n The power, @return {number} The result. */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants