How to create a UI Action that onClick redirect to specific field in the current form in SOW

Alon Grod
Tera Expert

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:

WhatsApp Image 2023-09-21 at 09.00.23.jpeg

6 REPLIES 6

Kartik Magadum
Kilo Sage

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

@Kartik Magadum still not working.

WhatsApp Image 2023-09-21 at 09.40.00.jpeg