How to create a UI Action that onClick redirect to specific field in the current form in SOW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 11:07 PM
How to create a UI Action that onClick redirect to specific field in the current form in SOW?
I tried to use getElement('field').focus() but its not working:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 11:31 PM
Hello @Alon Grod
In the "Client" script section, you can use JavaScript to manipulate the DOM and focus on the desired field. Use the g_form object to interact with the form. For example:
function redirectToField() {
// Replace 'field_name' with the actual name of the field you want to focus on.
var fieldName = 'field_name';
var fieldElement = g_form.getControl(fieldName);
if (fieldElement) {
// Scroll to the field and set the focus.
fieldElement.scrollIntoView();
fieldElement.focus();
}
}
In the "Onclick" field, enter the name of the JavaScript function you defined, which is redirectToField in this example.
Set "Show Insert" and "Show Update" to control when the UI Action is visible.
Please Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Thanks & Regards,
Kartik Magadum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 11:40 PM