The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Callable Client Script from subflow

Annette Kitzmil
Tera Guru

Hello,

I have created a very basic subflow that I can run the server side code snippet using the background script in successfully.  Now, I want to create the same thing with a clinet side script in a UI action button.  I have added the necessary ACL and made the subflow Callable by Client API.  I copied the client side script from the subflow and added line 57 the console.log the name out.  I wasn't sure about line 43 - for what the inputs should be, but I tried with current.filenet_document_id and also used the actually document id string.  When I click the Open Document UI button, I am getting Failed to execute the UI Action.  Please contact your administrator error message.  

 

Ultimately, this will be utilized to open archived documents, but for now, I just want to establish a base.  What would be my best option in this case?  I appreciate any insight.

 

AnnetteKitzmil_0-1704812900933.png

 

Thank you

7 REPLIES 7

Elijah Aromola
Mega Sage

Does this need to be triggered on the client side specifically? Can you change your UI action to run server side? The script shown can only run on the server side. Current is not available on the client.

This code snippet was taken directly from the subflow client side, so I am confused as to why you think it is server side.  I am using a button to initiate this task and I my understanding is that due to it being a button, that I must use a client side script.  So, if you can further elaborate, it would be greatly appreciated.

Apologies- I misunderstood. Are you able to get the value of filenet_document_id by using g_form.getValue("filenet_document_id")? Current won't be a defined object on the client.

Thank you, apologies not necessary, I am still learning and really appreciate the feedback.  I did try the g_form.getValue("filenet_document_id") and am still getting the same error.  I have tried a lot of variations to no avail.  Any other suggestions are welcomed.