1
0
-1

After a submission, it’s possible for the user to get access to the PDF receipt of an application – also, using TM, you can obviously access the PDF of an application at any stage. What I’m wanting to do is have a button on screen which emails the current version of the PDF to our support team so that they can help a user without the need for a TM logon.

In a Dynamic Data service, I have the following included to add the PDF as an attachment to an email:

import com.avoka.fc.core.service.ReceiptDataService;
import com.avoka.fc.core.entity.RequestLog;
attachmentMap.put("PDFReceipt", ReceiptDataService.getReceiptPdf(submission, RequestLog.MODE_RECEIPT));

 

I am getting an error logged for the service call: "No signature of method: static com.avoka.fc.core.service.ReceiptDataService.getReceiptPdf() is applicable for argument types: (com.avoka.fc.core.entity.Submission, java.lang.String)".... I'm sure that this actually should work so I'm now unsure as to how to continue with this.

Any ideas? If there is an easier way to access the receipt PDF than the above then more than happy to try it!

Cheers,
Rich 

    CommentAdd your comment...

    3 answers

    1.  
      3
      2
      1

      Hi Richard,

      The getReceiptPdf method isn't static, so you'll have to get an instance of the ReceiptDataService first. I'd suggest using the ServiceFactory for this:

      import com.avoka.fc.core.service.ServiceFactory;
      import com.avoka.fc.core.entity.RequestLog;
      def receiptDataService = ServiceFactory.getReceiptDataService();
      attachmentMap.put("PDFReceipt", receiptDataService.getReceiptPdf(submission, RequestLog.MODE_RECEIPT));

       

      Regards,

      Dave.

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

        I emailed back too soon! Worked it out!

        Thanks so much David (smile)

        Rich 

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

          Aha, beginners mistake there! Thanks very much!

          I have another tiny issue with this; I am writing this as a Dynamic Data script - so attachmentMap doesn't exist and needs initialising as a new Map - I can't get this to work either. Obviously if I did it as an EmailService I could refer to it directly but I need to pull in data from the form fields...

          Thanks for your help so far!

          Rich 

            CommentAdd your comment...