Retrieve Label at Server Side

snowlearner
Kilo Expert

Hello Experts,

Can anyone please let me know how one can retrieve the label of the field at server side.

Thanks!

5 REPLIES 5

ashik1
Kilo Guru

Hi snowlearner



Use - getDisplayValue()


link: http://wiki.servicenow.com/index.php?title=GlideRecord#getDisplayValue&gsc.tab=0



Regards,


Ashik Narayan


I do not want the value of the field rather I am in look for label.


Hi,



Here you go. You can use getLabel() to get the label at server side.


Check section 9.10 for more info.


http://wiki.servicenow.com/index.php?title=GlideRecord#getLabel&gsc.tab=0


Thanks Pradeep, but I have already looked at that link and it worked too.


However my requirement is slightly different. We are using discovery for populating our cmdb. On hardware Asset's form there are two fields - location (database name is location and the table is cmdb_ci) and discovered location(database name is location and the table is alm_asset) , now whenever the discovery runs it populates only the discovered location field and therefore the field location automatically get replicates. So the problem is whenever the user manually updates the field - "location", the discovered location field get also updated with the location field value (I understand the logic because here the database name of both of the fields is same i.e. location).



Can you suggest something how can we let these two fields behave independently??