The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What is the difference between current.getTableName() and current.sys_class_name in terms of operation

sam352120
Kilo Guru

Hi All,

 

I have used both current.getTableName() and   current.sys_class_name in an existing Business to perform a specific operation .I got the desired output

by using current.sys_class_name ,But that did not work for current.getTableName().Please share your valuable inputs(practical scenario) apart from the Wiki.

 

Thanks in Advance.

13 REPLIES 13

Viswanatha Red3
Mega Expert

Hi,


getTableName() is mostly used in retrieving the table name in the client script [g_form.getTableName()] similar to getting the unique value [g_form.getUniqueValue()].




We can even use this function even at server side current.getTableName(). However, since we have the desired return value of this function in a column sys_class_name, it is advisable to use the field for verifying instead of calling a function. This would reduce effort in calling the function and executing another few statements in the function.




Regards


Viswanath


Hi Viswanath,



Thanks for the timely reply.Irrespective of the lengthy execution both the condition must return the desired output.


I am getting the expected result for sys_class_name but not for getTableName()!.



What can be the   specific reason behind that......Please clarify.


Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Sambit Rath



You will not get the desired output if you use the "current.sys_class_name" on any custom table which doesn't inherit the task table.


However you can use the "current.getTableName()" and ""current.sys_class_name" on any table which inherits the task table to get the desired output


Spot on Pradeep Sharma