What is sys_class_name?

praveenpara
Kilo Explorer

HI,

What is sys_class_name? How can I use?

i Have seen many place sea it is using.

ex:

${sys approval.sys_class_name} ${sysapproval} Approval Request${sysapproval.sys_class_name} ${sysapproval} Approval Requestregards,

RRegards,

Praveen

10 REPLIES 10

HI pradeep,


thank you,



${sysapproval.sys_class_name} ${sysapproval} Approval Request Is returing


Request item RITM000887 approval Request.



also I wanted to get the name or shot description of the request item.



i Got confused here. Can you please tell what exactly happeninag.



regards,


praveen


${field_name} outputs the display value of that field



sysapproval.sys_class_name outputs the actual value of the field



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hi Praveen,



${sysapproval.sys_class_name} : prints the table name i.e sc_req_item


${sysapproval} : prints the field display value




You can dot-walking to get the fields of the reference table like ${sysapproval.number} //will give number of the requested item.




Please let me know if you have any questions.




ayush_saxena
Tera Expert

Can I also get Display Value here ? I understand gs.addInfoMessage(current.cmdb_ci.sys_class_name); will return CI class name for instance cmdb_ci_unix. I want to pull out the display value here i.e Unix. Is it possible ?


tarleen
Tera Contributor

Hi Praveen,


When you mark a table as extendable, you are also adding a second system field: Class [sys_class_name]--System Class Name.


It contains the name of the table that the record represents.



The sys_id field uniquely identifies a record. In the case of an extended table, the sys_id field is actually stored in two places: on both the parent and child tables. The platform joins both together whenever you query the child table and the field sys_class_name is added on the parent table.


In other words,   sys_class_name can be defined as: If the table is extensible, a string field that indicates which child table contains the record.



Thanks,


Tarleen Kaur