Onclick client validation on Service Operation Wrokspace UI Action

dipesh11020
Tera Contributor

fix_button_native_ui.pngdeclarative_ui_action.pngHi Everyone,

I am working on the Problem Fix action in Service Operations Workspace (SOW) and have run into a limitation.

In Native UI, the Fix UI Action contains an OnClick client-side validation that runs before the action is executed. The validation checks whether the Problem can be fixed and displays an alert message to the user if the condition is not met.

In SOW, however, the Fix action is implemented as an OOB Declarative Action rather than the native UI Action. From what I can see, Declarative Actions do not provide an equivalent OnClick client-side script where I can implement the same validation logic before execution.

My Questions

What is the recommended way to implement client-side validations for Declarative Actions in SOW?
Is there an equivalent of the Native UI Action OnClick script available in Workspace?
Has anyone implemented a pre-execution validation that can stop a Declarative Action from running and display a message to the user?
Are Client Conditions the only option, or is there another supported approach?

In my specific case, the native UI Action prevents the Problem from being fixed when certain Problem Task conditions are not satisfied. I am looking for a way to achieve the same behavior in SOW while following supported best practices.

Any suggestions would be greatly appreciated.

 

1 REPLY 1

HarishKumar6668
Tera Guru

Hi @dipesh11020 ,

  1. Declarative Actions support the following implementation methods:

    • Server Script

    • Client Script

    • UXF Client Action

    • UI Interaction (New)

      HarishKumar6668_3-1784706185675.png

       

    If you implement the Declarative Action using the Client Script method, you can perform client-side validations before the action is executed. This provides an alternative to relying solely on Scripted Client Conditions or Client Conditions.

  2. Native UI Actions can also be reused in Workspaces, which seems suitable for your use case. In the Workspace section of the UI Action, you can add a client script that will execute when the action is clicked. Please refer to the screenshot below for reference.

    HarishKumar6668_2-1784706148430.png

     

  3. Another approach is to implement the Declarative Action using either a Client Script or a Server Script, validate the required conditions, and prevent the action from proceeding while displaying an appropriate informational message to the user if the validation fails.

  4. No, Client Conditions are not the only option. As mentioned in the first point, implementing the Declarative Action as a Client Script allows you to perform client-side validation before the action executes.

Regarding your specific scenario, I noticed that you've modified the Fix UI Action. Instead, I would recommend deactivating the existing OOB Fix Declarative Action and reusing the existing Native UI Action in Workspace, as described in point 2. This approach allows you to leverage the existing functionality while adding the required client-side validation.

I hope this helps! If it resolves your issue, please consider marking this reply as Helpful or Accept as Solution.

Regards,
Harish