Label Variable Set Value (Service Portal)?

stevejarman
Giga Guru

I have a Label type variable in a catalog item that I'm displaying through Service Portal.

I want to set the text of the label (called "change_window") through an onLoad Catalog Client Script.

I've tried g_form.setValue("change_window", "Whatever") and g_form.setLabelOf("change_window", "Whatever") but neither of those work (though they work fine for text fields).

Can anyone tell me how to set the text of the label?

13 REPLIES 13

samiul1
Tera Expert

tanumoy
Tera Guru

http://www.servicenowguru.com/system-ui/ui-scripts-system-ui/modifying-label-form-fields-client-scri...   Check this URL with the comments as well. Catalog Client Script sample is there in the comment section.


stevejarman
Giga Guru

Sorry, those links both relate to changing a field's label. I want to set a Label's value. i.e. a Variable of type "Label" - how do you set its "text"?


stevejarman
Giga Guru

Or maybe it works the same way... hang on, let me try this.