g_form.setLabelOf in onLOAD_record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 01:41 AM - edited 03-01-2023 02:07 AM
Here is my code:
g_form.setLabelOf('postal_address', 'Postal address');
var test = g_form.getField('postal_address');
test.help_text = 'Address to where invoice should be deliver';
but it is not working. I need to work on a script not data dictionary. I tried to put the code at console and found error. Please Help I just waNt to change the LABEL NAME and the BLUE MESSAGE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 01:51 AM
you want to change the label of field or variable?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 01:57 AM
Just label of the field and the blue message there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 02:07 AM
it's a variable and not field
you cannot change the help text dynamically using any OOB function.
You can show field message below that variable using g_form.showFieldMsg('variableName', 'Your Message');
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 02:14 AM
instead of Postal address (if delivery address differs from the address on billing document) I want to make it Postal address. Instead of Complete only in case the billing document needs to be sent physically to different address than the Bill-to-party address (BTP = the address shown on the billing document PDF) I want it change it to Address to where invoice should be deliver. Using code:
g_form.setLabelOf('postal_address', 'Postal address');
var test = g_form.getField('postal_address');
test.help_text = 'Address to where invoice should be deliver';