How can I get the field names in a form?

drberg
Giga Contributor

I'm trying to create a client script that will get all the names of all fields in for example the Incident table.

For example

When I go to create a new Incident the jslog will print the names of the fields.

Pseudo-ish code:

var fields = get names of fields;

for(i = 0; i < fields.length; i++) {

        jslog("Field " + i + ": " + fields[i]);

}

Result:

Field 0: number

Field 1: caller_id

Field 2: location

...

The reason I'm asking is because I'm trying to create an easter egg. I will of course post an article back in the community when the easter egg is done!

5 REPLIES 5

Community Alums
Not applicable

Thanks Mihir,


its worked for me.