Configurable Workspace - "New" button on Related List appears but does nothing (Zurich)

raguna
Tera Contributor

 

Hi everyone,

I'm working on a requirement in ServiceNow Zurich using Configurable Workspace.

Requirement

I have added a standard child cases-related list to a custom case record.

The requirement is to allow agents to create a new child case directly from the related list by clicking New.

What I've done

  • Added the Child Cases related list to the Workspace page.
  • Created a Related List Declarative Action.
  • Tried both:
    • Client Script
    • UXF Client Action (Create New Record)
  • The New button now appears correctly in the related list.

The problem

The button is displayed, but I cannot make it open the new record form.

With a simple script like:

 

 
function onClick() {
alert("clicked");
}
The alert is displayed, so the declarative action is being executed.

However:

  • g_form is undefined
  • window.location is unavailable
  • top.window is unavailable
  • g_modal is not available

For example:

 

 
function onClick(g_form) {
alert(g_form.getUniqueValue());
}

returns:

 
Cannot read properties of undefined (reading 'getUniqueValue')

I also tried using the standard Create New Record UXF Client Action, but I couldn't determine the correct event mapping. The events I tried (such as Query Updated and Wrapped Action Dispatched) did not open the record creation form.

Question

What is the recommended approach in Zurich Configurable Workspace to implement the New button of a related list so that it opens the creation form (modal or subtab)?

More specifically:

  • Which APIs are available from a Related List Declarative Action Client Script?
  • Is there a supported API to open a new record from a Client Script?
  • Or should this always be implemented as a UXF Client Action, and if so, what is the correct event mapping for the standard Create New Record action?

Any examples or best practices would be greatly appreciated.

Thanks!

1 REPLY 1

Ankur Bawiskar
Tera Patron

@raguna 

did you compare and check your declarative action against OOTB one?

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