Save the Form with changes and call Ui page on click of a UI action?

Sagar24
Tera Contributor

I would like to Save the form and call UI page on click of a UI action. For example, I would like to add some work notes and instead of clicking post button and i want the user to click on a custom UI button. On click of it has to save the form and render the UI page. How can we achieve this?

I have tried adding g_form.save() within the UI action and client script of UI page as well but it's not saving the form at all

Can anyone one know how to do it?

find_real_file.png

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Can you explain your business requirement?

In your above script you are doing save and then making a GlideAjax?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

User should be able to send notification (It's by integration to third party tool).. They are going to add some work notes to incident form and without clicking on 'Post' button, they would like to have a button at the top so they click on it and it should save the form and then call a UI page for input string because we don't want this field anywhere on the incident form neither on the UI or in the backend. That's the reason we are calling a UI page to ask user for a URL then we would like to send both the entered URL thru UI page and work notes using integration. 

Hi,

then why not ask them to input the work notes in some text field in UI page itself and update the record from UI page

regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

suvro
Mega Sage
Mega Sage

Use GlideDialogWindow() in UI action

use below in UI action

current.update();

action.setRedirectURL(current);

Now Use GlideDialogWindow() to open the UI page, pass the current object as parameter

In UI page create a field named work notes and get input for the same.

On Click of submit, update work note field of that record using GlideRecord

 

In your current page you not defined func1 and func2 in Client script. Hence nothing happening

find_real_file.png