Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Why doesn 't this work? All I want to do is open a new tab for a new Case record. When I click the b

e_wilber
Tera Guru

All I want to do is open a new tab for a new Case record. When I click the button nothing happens and nothing shows up in the error log:

 

e_wilber_0-1764088338444.png

 

1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@e_wilber 

the view you are when form opens should have parent field in it's form view

Also update as this

function onClick(g_form) {
    g_aw.openRecord("sn_customerservice_case", "-1", {
        query: "parent=" + g_form.getValue('parent')
    });

    // use this if you want the current case to be parent of the new one
    /* g_aw.openRecord("sn_customerservice_case", "-1", {
        query: "parent=" + g_form.getUniqueValue()
    });
	*/
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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