You are viewing limited content. For full access, please sign in.

Question

Question

Completing a task through the Forms Inbox vs. custom link?

asked on July 17, 2024

I noticed that when completing a task through the Forms Inbox, the window will automatically close when you approve a task. I attempted to re-create the task link, but when I approve, it redirects the user to the Forms Inbox instead of closing the window. Is there a parameter I am missing?

0 0

Replies

replied on July 17, 2024

This is more likely related to JavaScript functionality rather than a URL parameter.

When you open a link from the Forms Inbox, it is opening it via JavaScript hence why it hides parts of the browser UI, like the favorites bar, which it doesn't do when you navigate directly to the URL.

When a window is opened via JavaScript, the calling page has access to detect changes, attach event handlers, send/receive data, close the window, etc.

I've used a similar approach in my own applications where the sequence of events is like so:

  1. Link is clicked
  2. call window.open('url')
  3. user completes a task in the window
  4. window sends a callback to the parent window
  5. parent processes the callback and uses window.close() to close the window

 

However, much like Forms, if a user navigates to a task in my application from an email link rather than the UI, that new page has no "parent" so the callback doesn't run/trigger anything.

1 0
replied on July 18, 2024

That makes sense. I wonder if it's possible to achieve in the Modern Designer. I am launching the task link from a parent window, but I haven't been successful in trying to close it on submission. I'm assuming it has something to do with how JavaScript works in the Modern Designer.

0 0
replied on July 18, 2024 Show version history

I think the issue is that the form page itself is not where the callback originates, and you'd need the child window to tell the parent when it is "done."

When you submit/complete the task, it's the follow up page that would be sending the call to the parent; the reason for this being that attempting to close the page on the submit event could interrupt the submission.

Basically, there's nothing you could add to the form even in the classic designer because by the time it is "safe" to close the window, the window has already navigated away from the form page.

Additionally, what you want to do is usually prevented by CORS restrictions if where you have your link is not from the same host/origin as Forms.

The only way this sort of thing typically works is when both URLs have the same origin, or when you control both pages and can utilize the postMessage methods/events in the page that displays after submission, and even that introduces other security considerations.

TLDR; I don't think what you want to do is feasible for multiple reasons.

0 0
replied on July 18, 2024

What is your parent window? Is it a page you own or a laserfiche page?

0 0
replied on July 18, 2024

Thanks for the explanation. The parent window is another Laserfiche Form using the Classic Designer

0 0
replied on July 23, 2024

I ended up just creating a confirmation form within the process and setting the user task to auto-load if the next user is the same to give this illusion. There's a timer event that will interrupt the task after 1 minute.

0 0
replied on July 18, 2024

This is expected because the user task is no longer there, so Forms will redirect to Inbox page for you.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.