DOM manipulation script to work in workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 03:59 AM
How can we make a DOM manipulation script work in a workspace as well as platform view?
The UI type for the client script is All
Any leads will be much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 04:07 AM
Hi
What is your exact requirement ? what you want to achieve?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2022 05:58 AM
So I have to hide the hours, min, sec for a duration field and only the days should be visible.
the client script I used for that :
function onLoad() {
var doc = g_form.getControl("duration").ownerDocument,
win = doc.defaultView,
table = g_form.getTableName(),
hideHoursMinSecFields = function (field) {
function getElem (field, suffix, prefix) {
return doc.getElementById((prefix || "") + table + "." + field + (suffix || ""));
}
var controlHour = getElem(field, "dur_hour", "ni."),
controlMin = getElem(field, "dur_min", "ni."),
controlSec = getElem(field, "dur_sec", "ni."), cs;
if (controlHour != null && controlHour.style != null) {
controlHour.style.display = "none";
}
if (controlMin != null && controlMin.style != null) {
controlMin.style.display = "none";
}
if (controlSec != null && controlSec.style != null) {
controlSec.style.display = "none";
}
};
hideHoursMinSecFields("duration");
hideHoursMinSecFields("work_duration");
again, I am not able to remove the hour label, that's another issue.
But here I want the same to get reflected on the workspace as well.
Is there an option to do that?
I need to see the days only for a duration field in both workspace and UI view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2023 02:32 AM
did u find that we can use Dom manipulation in workspace?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2023 07:48 AM
No as far as I know it doesn't work in workspace