Managing PDF inside BPM

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • esendino
    Senior Member
    • May 2019
    • 158

    Managing PDF inside BPM

    Hello.

    We are defining a small logistic module and we need to send transport orders to different partners.

    We have managed to define a PDF template that contains all the necessary information.

    Now we are preparing a process in BPM to automate it. The first idea is that when certain conditions occur, the PDF is generated using that template and sent by mail to the carrier.

    As an alternative, we are looking at the possibility of storing that PDF and sending a notification to the carrier for them to download the PDF.

    What we know how to do so far is: Display the record whose information we want to generate in PDF, click on the option to print PDF, select the specific template we need to print and save it with the name we want. Everything done by hand.

    What we want to do is to automate that with the BPM.

    Is that possible?

    the difficulties we see fot the automation are:

    1.- we can't launch the PDF printing from the BPM. Apparently it can only be a manual process.

    2.- if we had succeeded in printing it, we have the problem of giving it a proper name. For example "transport order 123456".

    3. How can I associate the generated file to a certain record. In this case, store the PDF in a file field of the transport order record.

    4.- Once we have done that, we have to put it as an attachment in a mail automatically. As far as I know the mails inside the BPM use different templates that do not allow to attach a file.

    I don't know if the approach I am giving in espoCRM is the most suitable or there is another alternative. And if it is the right approach, how do I solve the described diificulties?

    Thank you very much for your help
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi,

    > 1.- we can't launch the PDF printing from the BPM. Apparently it can only be a manual process.
    > 2.- if we had succeeded in printing it, we have the problem of giving it a proper name. For example "transport order 123456".

    This will be possible in the next version of EspoCRM. See: https://github.com/espocrm/espocrm/issues/1675.

    > 3. How can I associate the generated file to a certain record. In this case, store the PDF in a file field of the transport order record.

    Can use record\create formula function (since 5.9.0) to create a document record with fileId = $attachmentId. $attachmentId is returned by pdf generation function. Or update transport order record with record\update function.

    > 4 .- Once we have done that, we have to put it as an attachment in a mail automatically. As far as I know the mails inside the BPM use different templates that do not allow to attach a file.

    Example: https://github.com/espocrm/documenta...extpdfgenerate

    You can apply new functions manually before release:





    Last edited by yuri; 04-17-2020, 01:21 PM.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • esendino
      Senior Member
      • May 2019
      • 158

      #3
      WOW!!!

      Really, really impressed. Thank you very much.

      I¡m a bit confused about releases. The last announcement in the Announcements forum is 5.8.3. I´m running 5.8.4. Your demo is running 5.8.5.

      You said on my points 1&2 that will be in next version.

      My point 3 you recommend to use record\create formula that mention is available since (5.9.0)

      My point 4 you recommend to use ext\pdf\generate and ext\email\send that are avilable since 5.9.0

      So I assume that everything will be available for version 5.9.0 and I see it is already finished and will be released on April, 30th


      If that is the case, I think I will wait for April 30th.

      You mentioned that I can apply new functions manually . This means that I may copy the code and define custom functions? Or you meant something different?

      Again. I'm impressed

      Comment

      • yuri
        Member
        • Mar 2014
        • 8440

        #4
        All these new functions are gonna be in 5.9.0.

        Release date is likely to be postponed. We have yet to test some stuff, but due to quarantine issues it can take more time than usual.

        The release notes can be found here: https://github.com/espocrm/espocrm/releases. 5.8.5 was released yesterday.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • esendino
          Senior Member
          • May 2019
          • 158

          #5
          Thank you

          Comment

          Working...