65
Views
7
Comments
Navigate to other screen after download
Question

Hei everyone,
im trying to download a PDF using ultimate PDF and move to another screen after that

this is how im trying to achieve that
but after some research i found out that download action need submit method for the button and runjavascript using ajax submit method

is there any other way to achieve this ?
Thanks before

Hi @Ticko di 

Sharing the oml in which we are downloading the content then redirecting to other screen.
you just need to put download functionality to another screen action and call it inside the download pdf and redirect action as shown below.

Then we call the download screen action inside main action.

Regards
Krishnanand Pathak

RedirectAfterDownload.oml

06/11/2023

I don't now if worked to somebody, but forme worked perfectly.

Thank you for sharing your knowledge

and

sorry my english


Hi @Ticko di,

Is the above solution worked?


Regards
Krishnanand Pathak

Hi Ticko,

One of the approach for your use-case  for Traditional application (Please mention the application type in your post for community to help you better) could be to 

  • Download the pdf using custom JS (using RunJavaScript server action) and then redirect to the target screen. 
  • I have set the pdf download button Method type to Ajax Submit

JS Snippet:

const linkSource = 'data:application/pdf;base64,' + '" + EncodeJavaScript(BinaryToBase64.Base64) + "';
    const downloadLink = document.createElement('a');
    const fileName = '" + EncodeJavaScript(PageTitle) + "' + '.pdf';
    downloadLink.href = linkSource;
    downloadLink.download = fileName;
    downloadLink.click();

Demo link: DownloadPDFTask

I hope this helps you!


Kind regards,

Benjith Sam

Can you share this OML you made with me?  I really need to refer to your idea.

Hi Ren,

Sure, refer to the attached oml.

I hope this helps you!


Kind regards,

Benjith Sam

TWA_Lab_DownloadPDFTask.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.