4

I have to create PDF file in trigger upon user approval through email. Since Getcontent() method is not allowed in trigger, I am using weservice to create PDF.

As user is approving through email only, it is not possible to get the session id to pass webservice.

Is there any way to get session id?

(Or)

is there any other way to create PDF from trigger?

Note: I am using PDF vf page in some other button also, to maintain integrity using the same page.

  • I am using standard Approval process email approval functionality
  • PDF will be stored as attachment to the record
9
  • Where do you need the PDF to go to after its been generated? Does it need to be stored or emailed? Commented Dec 11, 2013 at 10:06
  • are you using an email handler to parse the approval email or using the standard functionality?
    – PepeFloyd
    Commented Dec 11, 2013 at 10:09
  • Does it have to be trigger? Can't you add new email alert to the approval? Would need an email template which can be a Visualforce template with PDF attached...
    – eyescream
    Commented Dec 11, 2013 at 10:17
  • @eyescream thinking exactly the same, hence the question... :-) Commented Dec 11, 2013 at 11:32
  • 2
    Could you not just generate the PDF in a @future method called from the trigger?
    – Matt Lacey
    Commented Dec 12, 2013 at 0:46

1 Answer 1

1

I have resolved this issue by getting session id using Partner webservice in future Method which is invoked in trigger.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .