1
0
-1

Hi, 


Can you please advise how how to create a button which allow the user to download the PDF receipt on the submit page. In composer it was done using the below rule. Just not sure how to do it in maestro. 


if (sfc.formInfo.variant=='preview') {
return;
}
var url = sfc.getPhaseValue("DynamicDataServiceURL");
if (url) {
url += "?sfmRequestKey=";
var requestKey = sfc.getPhaseValue("RequestLogKey");
if (requestKey) {
url += requestKey;
url += "&sfmOperationName=renderReceipt";
if ("${render.mode}"=="file") {
url += "&renderMode=file";
}
sfc.openURL(url);
}
}


Thanks, 

Hannah 

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Hi Hannah,

      the script actually didnt change that much. This one works well on our project:


      if(Resource.preview||Resource.design) {
          return;
      }
      var url = Form.data.SFMData.SystemProfile.FormDataServiceURL;
      if (url) {
          url += "?sfmRequestKey=";
      	var requestKey = Form.data.SFMData.SystemProfile.RequestLogKey;
      	if (requestKey) {
          	url += requestKey;
      		url += "&sfmOperationName=renderReceipt";
      		if (item.properties.renderMode=="file") {
      			url += "&renderMode=file";
      		}
      		window.open(url,"_blank");
      	}
      }
      1. Hannah MacDonald

        That worked! Thanks Miro (smile)

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hello All, 

      There are a couple of items you should be advised of. 

      • First downloading the receipt immediately can put a large burden on the TM system during high volume.  For this reason the button was hidden from the default configuration in Maestro. This means you can request it to be shown easily, by contacting your template developer.  It is part of the Submit Success Modal Page.
      • Alternatively, the code in that button looks like this:
        Form.emailOperation('emailReceipt', item.id, item.properties.emailFieldRef)

      Cheers,

      Angie

        CommentAdd your comment...