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

SOW Workspace – Related List Declarative Action Client Script Not Executing

NeethuB
Tera Contributor

Hi Everyone,

I am trying to create a Related List Action in Service Operations Workspace (SOW) using a Declarative Action / Related List Action.

My requirement is very simple for now: I just want to create a Related List button and execute a client-side script when the button is clicked. As a first step, I am trying to display a simple alert message to confirm that the client script is being executed.

What I have done

  1. Created a Related List Action / Declarative Action.
  2. Selected the appropriate table used by the related list.
  3. Set Implemented As = Client Script.
  4. Added the action to the SOW related list.
  5. The button is successfully visible in the SOW related list.

However, when I click the button, nothing happens.

For testing, I tried a simple script such as:

function onClick() {
    alert("Hello");
}

But the alert is not displayed.

I have also tried using:

function onClick(g_form) {
    alert("Hello");
}

but I am still not getting any response when clicking the button.

My question

What is the correct way to configure a Related List Declarative Action in Service Operations Workspace (SOW) so that a Client Script executes when the related-list button is clicked?

Could someone please provide a minimal working example where clicking the Related List Action displays:

alert("Hello");

I would also like to understand:

  • Should Implemented As be set to Client Script?
  • Is there any additional configuration required for the Client Script?
  • Do I need an Action Payload Definition when using Client Script?
  • What should the correct client script function/signature be?
  • Is there any additional configuration required specifically for SOW?
  • If Client Script is not the correct approach, what is the recommended way to execute client-side logic from a Related List Action in SOW?

Once I can get a simple alert() working, my next step will be to replace it with my actual client-side logic.

Any step-by-step guidance or a minimal working configuration would be greatly appreciated.

15 REPLIES 15

Ankur Bawiskar
Tera Patron

@NeethuB 

did you check any OOTB Related list action and compare?

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

OOB there is no declarative action on related list which is implemented as client script.
But in yokohoma we build one and it is working fine. Once version is upgraded to australia its not woking.

i checked with other table's declarative action related list implemented as client script no changes found

Anand__99
Mega Sage

Dinesh Chilaka
Mega Sage

@NeethuB ,

Can i Know your instance version, because i have tried in Australia version.
I have kept simple alert message in client script, it works for me.

 

Thanks,

Dinesh