Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

New Contact Button is not working Properly

madhu110
Giga Contributor

Hi Team,

 

I have added a New Contact Button with Ui action on Service Now Workspace . On clicking + Menu  the  Create New Incident . Create New Incident Page is displayed. There on clicking New Contact , it is directed to Contact Directory Page. Here it is working but  When I am selecting on the list  page  of the incidents,  in the details Section, on clicking of New contact it is not working. Can any one please provide the solution , why ui action is not working Properly.

 

madhu110_0-1786458502474.png

It is working Properly here.

madhu110_1-1786458543850.png

but it is not working here.

 

5 REPLIES 5

Shivambitanwar1
Tera Contributor

@madhu110 is this a custom table? u_contact_directory . I realised that function g_service_catalog.openCatalogItem() is used to open catalog items and not a custom table. To open a custom table you need to use below code: 

 

 result.then(function() {
       
var parentTable = g_form.getTableName();
var parentId = g_form.getUniqueValue();

// Target field names must match u_contact_directory columns
var queryString = 'u_parent_table=' + parentTable + '^parent=' + parentId;

g_aw.openRecord('u_contact_directory', '-1', {
query: queryString
});
    });


Last check is to add onClick() in OnClick field on ui action form.