- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 01:19 AM
How to get the value of Label of a Table at client side ?
The backend name of Label Field is 'label' only. To get table name we have g_form.getTableName(). How to get the table label name as shown in below scrrenshot. Please suggest
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 02:44 AM
Well, if you want to change the header title then you might have to use DOM which is not recommended.
For this purpose, we have type field on the form, right?
If you still want to go with DOM, then try utilizing the below scripts on change_request table.
Display Business Rule.
(function executeRule(current, previous /*null when async*/ ) {
var chgType = current.type.getDisplayValue();
var tblName = current.getClassDisplayValue();
g_scratchpad.title = chgType + ' ' + tblName;
})(current, previous);
onLoad() Client Script
function onLoad() {
var arr = top.document.getElementsByClassName('navbar-title-caption');
arr[0].innerHTML = g_scratchpad.title;
}
Output:
In case, if it does not work then you can uncheck Isolate script check box in the client script and try again. See the below image for reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 01:25 AM
Hi, if you want to see what table name have this label then click on this with right mouse button, it open context menu in witch you should see table name for your label
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 01:33 AM
No, Thats not what I am looking for
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 01:35 AM
You have to write a display business rule on your table with following script.
g_scratchpad.tableName = current.getClassDisplayValue();
And then in your on load client script use it like below.
alert(g_scratchpad.tableName);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 01:41 AM
i did the same , but i dont have to pop up an alert..I have to set the value which is coming with the scratchpad variable as the label(or u can say the form header). If the sracthpad variable returns Normal change then my form header should show Normal Change Request. So therequirement is that i have to update my Form Header according to the type of change record.
Ideally the Change Request form header has Change Request and the Request Number as below :
I want it a prefix as Normal/Emergency/Standard before Change Request depending upon the Change type.