Configurable Workspace: Refresh Page or Attachments Sidebar on UI Action completion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2025 09:22 AM - edited ‎02-19-2025 09:40 AM
Hi Workspace Superstars,
I've created a UI Action that is based on PDFGenerationAPI and generates the PDF document based on the current Purchase Order records and related data.
Unfortunately after the process is completed, the attachment is not immediately visible in the Attachments section of the sidebar and I am not able to force the form refresh of the entire workplace form either. This creates a poor UX where the user must manually refresh the page to see the outcome of their UI Action.
My UI Action is set to client = false and here's the script:
// Build the PDF content and attach it to the record
var v = new sn_pdfgeneratorutils.PDFGenerationAPI;
var gr = new GlideRecord("proc_po");
var currentRecord = gr.get(current.sys_id);
var html;
var currentDate = new GlideDate();
var formattedDate = currentDate.getByFormat("dd.MM.yyyy");
// html string including server side scripting to dynamically build the document goes here
if (currentRecord) {
html = ;
}
var hfInfo = new Object();
// lots of hfInfo properties are here
var result = v.convertToPDFWithHeaderFooter(html, "proc_po", current.sys_id, "ITBestellung-" + current.number + "-" + formattedDate, hfInfo);
action.setRedirectURL(current);
function onClick(g_form) {
g_form.reload();
}
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
Hi Michal! Any luck on accomplishing this? I'm facing the same issue but with the Customer Order [sn_ind_tmt_orm_order] table. I actually have the same functionality applied to Quote table [sn_quote_mgmt_core_quote] and it is working well. The attachment is added after 2 seconds even without setRedirect or .reload. 😕
