How to create a new record using a ui action calling a ui page?

josenava
Tera Expert

Hello everyone,

How can I create a new record using a ui action calling a ui page? this is what I have so far:

1. ui action

find_real_file.png

2.ui page ( thank you to https://community.servicenow.com/community?id=community_article&sys_id=bb0e039fdb9b1054b1b102d5ca961942)

find_real_file.png

find_real_file.png

What I'm having problems now is, how can users click on the UI action, see the pop up window (ui page), add the information requested, click on Submit and create a new record with the information from provided?

Thank you

1 ACCEPTED SOLUTION

Ok let me give you Quick Demo here. 

This is what i have built. See if this help you or not. 

 

find_real_file.png

 

Note: if the intent is to create child task from ui page button click then use inside ui page client script . like i have done. 

View solution in original post

13 REPLIES 13

So the issue is your child task has not attached to your ritm ? this is the issue you are facing ?

 

if yes then you have to pass the sc_req_item record sysid and then in glide record you will use to set it like below. 

 

 

var gr = new GlideRecord('sc_task');
gr.initialize();
gr.description= description;
gr.request_item= <ritm sysid which you have to get>;
gr.insert();

 

Reference:

To pass value from ui action to ui page html and then using the html field value in ui page client script. 

 

https://servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/

The issue I'm facing is that the script I have in the UI action to call the ui page does not work because I have this:

find_real_file.png

this creates the the child task directly but does not call the ui page. My question is what do I need to add/modify in the script in the UI action to call the UI page?

Thank you

Ok let me give you Quick Demo here. 

This is what i have built. See if this help you or not. 

 

find_real_file.png

 

Note: if the intent is to create child task from ui page button click then use inside ui page client script . like i have done. 

Exactly that is what I need, and yes the intent is to create a child task from the ui page button click, I will use your information and let you know my results shortly...

Thank you it is working as I expected,

Thanks for your support!