Download all documents from an account

I was looking for this online with no luck so I had to develop it… :woohoo: :woohoo:

I post my solution here just in case anyone needs it…

It’s a very simple solution and it has some hardcoded strings. It also works for a custom HR module I’m developing, so you can see how to adapt it to work with any module…

It’s just a first version and I’m sure it can be improved here and there, but… I will keep working on it until I make a pull request on this…

This widget composes a link to a download multiple files javascript with the document ids separated by a | character.

For now, here you have…

  1. You have to add the widget on the Accounts documents subpanel topButtons…
    2 => array ( ‘widget_class’ => ‘SubPanelTopExtractDocumentsButton’,
    ‘submodule’ => ‘Accounts’,
    ‘relationship’ => ‘documents’, ),

  2. Copy the widget on custom/include/generic/sugarWidgets

  3. Copy the javascript into custom/modules/Documents

And that’s it, enjoy it!

1 Like

is it possible to do it for History and Documents subpanel in Leads module? If yes, please explain it to me, How can do it. I want to download all documents in History and Documents subpanel.

Regards,

Well, to download leads’s document you only have to change the first two steps:

  1. You have to add the widget on the Leads documents subpanel topButtons…
    2 => array ( ‘widget_class’ => ‘SubPanelTopExtractDocumentsButton’,
    ‘submodule’ => ‘Leads’,
    ‘relationship’ => ‘leads_documents’, ),

It should work…

But I haven’t tried to work with history documents…