How to change field alignment of Integer type from right to left side on workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2023 02:21 AM
Hi
I want to change alignment of integer type field from right side to left side on workspace. I tried field styles and onload client script but did not work. How can I achieve this?
function onLoad() {
//Type appropriate comment here, and begin script below
var myField = 'estimated_usd'; // add correct name here
var ctrl = $('sys_display.' + g_form.getControl(myField).id);
var displayControl = g_form.getControl('estimated_spend_usd');
displayControl.style.background = 'red';
ctrl.style.textAlign = 'left';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2023 11:50 PM
@Raviteja Kunal1 Hey did you got any solution for the above question ?
If YES please post the solution here ...
I am able to achieve it in a form view by updating the variable style to text-align:left, but it is not working in workspace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2023 11:19 PM
No we are not able to, even ServiceNow team confirmed this for Workspace.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 11:24 PM
Hi @Raviteja Kunal1 ,
Try the below onLoad client script, it's working for me!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2025 01:02 AM
Hii,
this works great for native view but isnt reflected in workspace. is there any workaround available ?