Method Community

 

How do I Insert a Generate Report action result into the document field in the Library table?

Last post 11-24-2015 9:47 AM by Method_Ben. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 11-22-2013 2:19 PM

    • l.brandow
    • Top 25 Contributor
    • Joined on 03-18-2011
    • American Fork, Utah
    • Posts 243

    How do I Insert a Generate Report action result into the document field in the Library table?

    I created a button. 

    In the button action sequence I generate a report and an action result from the report.

    I then have two 'Insert Into Table' actions after that. One to create a Document Library record. The other to create a Document Library Link record. It all works just fine AS LONG AS I don't use the action result from the report as the value to insert into the Document field in the Document Library table.

    Which, of course, is the whole point.

    I want to generate a report and save it as a document in the document library at the same time.

    Here is what the report action result looks like:

     ~DirPDF~Engagement Letter_6140447_20131122020942.PDF

    In the generate report action Properties is says, "Silently generates a report, based on specified filter criteria and saves the report as a PDF on the server. The name and location of the PDF is then saved as an Action Result, so that it can be used later as a file attachment in a Send Email action. Neither the report nor the PDF are visible on the screen" 

    I guess, I thought the report action result could be used for other things too, not just an email attachement. 

    Am I doing something wrong? Is there a better way to go about this?

    Thanks in advance,

    Lance

    Lance Brandow
    Method Customization Expert
    Brandow Consulting
    (801) 687-3254
  • 11-27-2013 11:12 AM In reply to

    Re: How do I Insert a Generate Report action result into the document field in the Library table?

    Hello l.brandow,

         Sorry for the late reply.  I looked into this and did a couple of trial runs.  I have had some success in getting a generated report from an Invoice to be added to the Documents list for the same invoice.  I used the Character Function on my Generate Report button, after the Generate Report action, to cut the ~DirPDF~ off of the Action Result. I put the result into another Action Result (AR2) with the cropped file name.  With this new Action Result (AR2) value, I went to the Document Library Link and added a new record.  The new Action Result (AR2) equalled the Document field.  For the Invoice field, I put the screen's RecordId.  You will have to set other fields, but those are the bare minimum.

         I don't believe you have to touch the DocumentLibrary table since the record should be there already.  The one issue I had was that the IsActive doesn't look like it is checked when a report is generated.  You may be able to set a button action to check it.

        It is a complex customization.  I will take a little more time to look at it and see what else I can recommend. 

    - Greg

        

    Greg Bilous
    Community Support Specialist
    Method Integration
    g.bilous@method.me
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400 ex.756
    Fax: 416.640.6027
  • 12-02-2013 3:27 PM In reply to

    • l.brandow
    • Top 25 Contributor
    • Joined on 03-18-2011
    • American Fork, Utah
    • Posts 243

    Re: How do I Insert a Generate Report action result into the document field in the Library table?

    Hey Greg,

    Thanks for the response.

    I'm not seeing an invoice (or any report) automatically added it to the DocumentLibrary table. I clicked on the print preview on the invoice screen. A report was generated with this url https://report.methodintegration.com/Reports/otbt/Invoice%20(Product)_7171318_20131202015338.PDF Then I went to the documentList screen. No new record was there even after refreshing the grid and changing the filters from 'Shared Active Documents' to 'Shared Documents'. The grid on the CRM_DocumentList screen is built off the DocumentLibrary table, not the DocumentLibraryLink table so it should appear here as you described even if it's inactive. Just in case I missed anything I added another grid filter to show All. Still nothing appeared.

    When I tried what you described iI got this error:

    Error^The value 'Engagement Letter_3503182_20131202124438.PDF' was not a valid dropdown list value for 'DocumentRef'.

    My generate report action generates this action result: ~DirPDF~Engagement Letter_3503182_20131202124438.PDF. I removed the ~DirPDF~ with a couple of charater funtions like you said and inserted the 2nd action result cropped (Engagement Letter_3503182_20131202124438.PDF) into the Document field in an 'insert record into table' action for the DocumentLibraryLink table. 

    The DocumentLibraryLink table has one required field: the document field. When viewing this field in the table it says its a dropdown field for the Name field in the DocumentLibrary table. So a DocumentLibrary record definately needs to exist whether I create it with an action or it's automatically created with a GenerateReport action. 

    What am I missing? I couldn't replicate what you described.




    Lance Brandow
    Method Customization Expert
    Brandow Consulting
    (801) 687-3254
  • 12-02-2013 4:56 PM In reply to

    Re: How do I Insert a Generate Report action result into the document field in the Library table?

    Hello l.brandow,

       I have been trying this out off and on.  I looked into the records I did create and it looks like the relationship between DocumentLibraryLink and the DocumentLibrary wasn't formed correctly.  I'm not sure how the records saved at all on second look.  It looked to me like a solution, but the PDF seems to be inaccessable.

        I am looking around and asking how this can be done. Currently, I can't find another case that someone was trying to do the same thing.  It is a complex customization question.  I'll see what I can come up with.


    - Greg

    Greg Bilous
    Community Support Specialist
    Method Integration
    g.bilous@method.me
    Toll Free: 1.888.925.6238
    Local and overseas: 416.847.0400 ex.756
    Fax: 416.640.6027
  • 11-20-2015 6:58 PM In reply to

    • l.brandow
    • Top 25 Contributor
    • Joined on 03-18-2011
    • American Fork, Utah
    • Posts 243

    Re: How do I Insert a Generate Report action result into the document field in the Library table?

    It turns out I have another client that needs this. When he clicked Save and Email he would like the document (invoice, estimate, sales order etc) to automatically store in the file and appear in the customer documents record. 

    The basic plan I need to accomplish is:

    1. Generage a report without previewing it and saving it as an Action Result. 

    2. Inserting that action result into the Document Library.Document field. 


    More research and clarificatoin on this would be much appreciated. I really, really reeeeeally need this done.


    Thanks!

    Lance Brandow
    Method Customization Expert
    Brandow Consulting
    (801) 687-3254
  • 11-24-2015 9:47 AM In reply to

    Re: How do I Insert a Generate Report action result into the document field in the Library table?

    Hi There Lance,

    Ive just had a chat with the team here, and unfortunately the way you are trying to do this is not possible. Ultimately you will need to use the Upload Wizard to upload documents to method, as there is no way to upload a document via an insert action.

    The best course of action would be to Generate and Save the Report and Upload it manually, or to have the document Emailed to yourself and stored that way.

    Im not sure of the complexity of implementing this in the future, but im going to submit a feature request for our development team for a potential future release.

    Thanks Lance.

    Regards,

    Ben

    Ben Hargreaves
    Senior Support Specialist
    Method:CRM
    b.hargreaves@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
Page 1 of 1 (6 items)