Record producer client script onSubmit

wakespirit
Kilo Guru

Dear all,

When we define a client script on record producer of type onSubmit

Q1  : Does this script is executer before record gets submit, at same time record gets submit, or after record gets submit and recorded ?

 

Q2 : I am calling my record producer by using a GlideModal APi, is there a way to close the GlideModal on this onSubmit script ? I have try GlildeWindow.get().destroy()  but it does not work

Any idea ?

regards

10 REPLIES 10

Sanjeev Kumar1
Kilo Sage

Hi wakespirit,

Your onsubmit script will only run when user click on "Submit" button.

In your Record produser script at the end try this code.

 

var urlOnStack = GlideSession.get().getStack().bottom();
response.sendRedirect(urlOnStack);

 

 

what this script will do ?

I place it in my Record producer client script onSubmit, but it does not works it hangs the submit process

Pooja Mallikarj
Kilo Sage

Hi,

The onSubmit client script execute after clicking on ''submit'' button on form

After submitting the button the records get populated into the table which is specified in Record producer.

 

For closing the GlideModal on the onSubmit client script ,the below code may help you.

var modal = new GlideModal('page');

modal.setBackdropStatic(true);

For more details refer the below link.

GlideModal closing

 

Please mark correct/helpful if it helps for you

Regards,

Pooja

var modal = new GlideModal('page');

modal.setBackdropStatic(true);

 

This 2 line close the window or should I call the GlideWindow,get().destroy() after this 2 line on onSubmit scrip t?

Thanks for clarification