What is the best way to auto populate a new form when you click a related link?

Ben F_
Giga Contributor

Hey all, 

I have created a related link on the incident record that takes you to a new record. (A table I have created) On the new record, I am trying to auto populate the incident field and some of the other fields (configuration item, location, customer,etc) from the incident record you click the link on. 

In short, click a related link > take you to a new form > new form has auto populated fields from the incident record you were on. 

 

Let me know if you need more details and I will try to accommodate. 

Thanks, 

Ben

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ben,

you can send those values into the URL as parameter; in onLoad client script of the table fetch the values from the URL and set it on form

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

View solution in original post

5 REPLIES 5

AbhishekGardade
Giga Sage

Hello Ben

Check out the below thread, with the help of this you can achieve your goal.

https://www.servicenowguru.com/system-ui/glidedialogwindow-quickforms/https://www.servicenowguru.com...

I have implemented the same solution recently. So let me know if you face any issues on it.

I will share the community thread that I have created. Also I am planning to publish article tommorow on it.

Please Mark  it as helpful/correct, if you find it as helpful.

Thanks,

Abhishek Gardade

Thank you,
Abhishek Gardade

Any updates on this?

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thanks,

Abhishek

Thank you,
Abhishek Gardade

SanjivMeher
Kilo Patron
Kilo Patron

This is how I do it. I create a Client UI action with following script.

onClick: createNewIncident()

function createNewIncident(){
var incForm = "/incident.do?sys_id=-1&sysparm_query=assignment_group=" +g_form.getValue('assignment_group')+'^cmdb_ci='+g_form.getValue('cmdb_ci')+'^location=g_form.getValue('location')';
g_navigation.openPopup(incForm,'blank');
}

 

Pass any additional value you would like to pas to the sysparm_query


Please mark this response as correct or helpful if it assisted you with your question.

Does this create a new incident or auto populate the new form? 

 

Also, my onClick doesn't seem to be working.