Callable Client Script from subflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 07:14 AM
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.
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 07:31 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 09:39 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2024 09:47 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 07:00 AM
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.