Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Script - Changing Submission Format

JoshDBoyle-DVzR
Level 4
Level 4
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
pguerett
Level 10
Level 10
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.
Not applicable
Alternatively you can use the following format:

xfa.resolveNode("Button1").nodes.item(0).nodes.item(0).setAttribute("pdf","format");
JoshDBoyle-DVzR
Level 4
Level 4
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?
pguerett
Level 10
Level 10
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.
JoshDBoyle-DVzR
Level 4
Level 4
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.
pguerett
Level 10
Level 10
What happens if you hit your button on the form? What if you take your button away?
JoshDBoyle-DVzR
Level 4
Level 4
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.
Luigi_247_365
Level 2
Level 2
"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.
JoshDBoyle-DVzR
Level 4
Level 4
No dice 😞



Let me propose a more basic question: How do you submit a "Document Form" variable within Workspace?
pguerett
Level 10
Level 10
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.
JoshDBoyle-DVzR
Level 4
Level 4
I sent it over. Let me know if you need anything else.
yodadobe
Level 6
Level 6
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.
Tomaž_K_
Level 2
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
Tomaž_K_
Level 2
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?
pguerett
Level 10
Level 10
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.
Tomaž_K_
Level 2
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.
Tomaž_K_
Level 2
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).
Tomaž_K_
Level 2
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.