How to redirect user to New Record after form is submitted using Business Rule or Client Script

Community Alums
Not applicable

HI Team,

 

I have a requirement wherein once a record is saved on a form I need to route the user to the New record creation form.

 

I need to achieve this using BR or Client Script?

4 REPLIES 4

Yashsvi
Kilo Sage

Hi @Community Alums,

 

To achieve the requirement of routing the user to the new record creation form after saving a record, you should use a Client Script. This can be done with an onSubmit Client Script that checks if the form is being saved and then redirects the user to the new record form.

 

   - Type: Select "onSubmit".

 

 

 

    if (g_form.isNewRecord()) {
        
        setTimeout(function() {
            
            window.location.href = g_navigation.getNewRecordForm(g_form.getTableName());
        }, 1000); // Adjust the delay as needed
    }
})(current, previous);

 

 

Using a Client Script ensures that the redirection happens on the client side, providing a seamless user experience without requiring a server-side interaction that a Business Rule would entail.

Thank you, please mark helpful, if you accept the solution.

Community Alums
Not applicable

This is not working, I am using scoped application.Not sure if that is the reason.

My requirement is once a record is submitted then user should be redirected to the new form page of same form

SN_Learn
Kilo Patron
Kilo Patron

Hi @Community Alums ,

 

You can try below in business rule:

action.setRedirectURL(current);

 

Please mark correct/helpful if applicable.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Community Alums
Not applicable

@SN_Learn Its not working