Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Script - Changing Submission Format

Avatar

Former Community Member
All



I need a line of Javascript of FormCalc code that changes the form's submission type from XDP to PDF. I have arrived at the following but am unsure if it is correct:



$.#event.#submit.format = "PDF";



Any ideas?
18 Replies

Avatar

Former Community Member
Here is the javascript command assuming that your button is called EmailSubmitButton1:



EmailSubmitButton1.event__click.submit.format = "pdf";



Note that the parameter pdf is case sensitive and must be lowercase.

Avatar

Former Community Member
Alternatively you can use the following format:

xfa.resolveNode("Button1").nodes.item(0).nodes.item(0).setAttribute("pdf","format");

Avatar

Former Community Member
Hmmm I believe both of the above work but my problem still persists. Let me explain further:



I am using an XFA Form throughout my workflow but prior to the final user step (a step where a Digital Signature will be applied) I covert the XFA to a Document Form. This Document Form is then what I present to the user at the final workflow step.



Since it is a Document Form, my Workspace button of "Complete" isn't working and I was told that if I changed the submission type of the form's submit button from "XDP" to "pdf" then it might.



Any ideas?

Avatar

Former Community Member
Ah now I understand what is happening ..... doid you drop the process fields onto your form? If you did, then it the Hierarchy view you can click on the FSSSUBMIT_ button. Then in the Object palette, click on the Submit tab. In the Submit As dropdown select PDF. Save your form and try it again.

Avatar

Former Community Member
Well, I believe I need the submission to be XDP throughout the workflow and only have it change to PDF prior to the final user step where the form gets Digitally Signed - thus my request for the code to do so dynamically.



I tried applying the code you offered on the FSSUBMIT_ button as opposed to my actual Button1 I put on the form but to no avail. When I click the "Complete" button in Workspace, the form just sits there.

Avatar

Former Community Member
What happens if you hit your button on the form? What if you take your button away?

Avatar

Former Community Member
When I try to click on either my generic submit button (Button1) or on the FSSUBMIT_ button, I get a message box displayed that simply says "Submit cancelled".



The form doesn't go anywhere.

Avatar

Former Community Member
"Submit cancelled" - you may have added your own scripting to the process fields default scripting, that is causing an issue.



coming back to your original question - try the following below:



Javascript



PDF Submission

event__click.submit.textEncoding="UTF-16";

event__click.submit.xdpContent="pdf datasets xfdf";

event__click.submit.format="pdf";



XDP Submission

event__click.submit.textEncoding="UTF-16";

event__click.submit.xdpContent="pdf datasets xfdf";

event__click.submit.format="";



hope it helps.

Avatar

Former Community Member
No dice :(



Let me propose a more basic question: How do you submit a "Document Form" variable within Workspace?

Avatar

Former Community Member
You have to make sure the process fields and the form bridge are present on the form....as well you have to use the correct renderer. In this case the default renderer can be used.



If you want to export your process to an LCA and post it to livecycle8@gmail.com I will load it and have a look at it.

Avatar

Former Community Member
I sent it over. Let me know if you need anything else.

Avatar

Former Community Member
Luigi,



Just to let you know those snippets were helpful to me. I have my originator submit as a PDF to get attachments then have subsequent approvals submitted as an XDP.

Avatar

Level 2
I'm having similar problems.



When I change the "Submit As" property on the FSSUBMIT_ button to "PDF" an error occurs while submitting the form (with signature):

Task 1811 has failed to submit. (ALC-WKS-007-072)



A more detailed look at the log reveals this:

ALC-WKS-005-029: A problem occurred in the Submit Service. Please review the submit orchestration for this process.



I tried adding Form Bridge but that doesn't seem to help either.



Here are some facts:

- I'm using static pdf form

- I'm using xfaForm as my input variable on the background process

- I'm using "Default Render ES Update1" render service

Avatar

Level 2
One more thing... just to make things more clear.



In case I want to submit my form with attachments or with digital signature - which document type do I need to create - XDP or PDF?

Avatar

Former Community Member
Attachments and Dig Sigs must be submitted as PDF. Those things are not included in the XML file. Note thaat in Process Management you must use Document Form to recieve this submission not xfaForm.

Avatar

Level 2
Thank you for your answer. That's exactly what I tried after I've posted my last message. Changing the data type of the input variable did the trick for me. I'm surprised no one suggested that before.

Avatar

Level 2
Is there a way to extract the values inside datasets?



My process requires the initial XSD (with data).



I've tried using processFormSubmission and exportData to transform PDF to XML but I was only able to get the structures of the datasets (without data).

Avatar

Level 2
I already found a solution in one of your
posts. But I was wondering if I could achieve something similar inside my process after submitting the PDF form.