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

Changing the DOR for the Using API to generate Document of Record in AEM Forms


Level 2



I have implemented the sample and it works but I am not sure how to point this to my real DOR.

Any help would be great.


9 Replies



Can you please give some more details of the use case?


Level 2



The sample form has a button that uses the API to produce a "preview" of the DOR with the content of the adaptive form.  When I implemented the button on my form it still uses the DOR of the sample form.

Below is the function as you can see the DOR for the sample is hardcoded.

* Get pdf
* @Return {OPTIONS} drop down options
function getPdf()
console.log("in view pdf");
success: function(result) {
var formData = new FormData();
console.log("got data";
var settings ={
"async": true,
"url": "/content/AemFormsSamples/getdor.html",
"method": "POST",
console.log("got response");,'_blank');

error:function(guideResultObject) {console.log("got error"); },
guideState : null,
boundData : true});




Do you have a specific template that you want to merge the data with?



Level 2

Yes, It is attached my form.  What I don't understand is why the sample hard codes the DOR to the sample and doesn't reference the form that it is being called from.



I am in the process of updating the sample code to take in the xdp name in the request parameters

that way you can use the code to meet your use case


Level 10

@NoelleSmith81 The dor in the sample takes the dor xdp node path from the jsp, you can update the ajax call and send a parameter in the function on the button click that has the form path. you can get this parameter in JSP just like data and that's it.



in form

const='some path'



update ajax


function getPdf(formPath)



update the jsp as well.