Hello,
We would like to have a functionnality allowing to save an e-mail attachment to a Case without leaving sugarcrm interface. Right now the only way to do this is manually by downloading the file and then upload it as a document.
What is the best way to implement this ? Using the API ? (https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.9/Integration/Web_Services/v10/Exampl… )
Attachment in mail :
Goal (link attachment as a document to the case):
Thank you for your help
We had the same requirement some years ago (2012).
The requirement was to have every attachment to inbound or outbound emails on Case queues to be in a "Case Attachments" module on the Case.
From a technical standpoint, I regret satisfying that request because each file has to be duplicated on the file system, so there is a copy for the attachment on the email and a copy for the attachment on the Case.
Having said that, here is how we did this:
We wanted to keep these attachments separate from the "Documents", so I created a module called Case Attachments (attch_CaseAttachments) using Module Builder as a "documents" type module and added a relationship between that module and the Cases module.
In the Emails module I added an after_relationship_add logic hook that checks if the related module is a Case and does a number of things, among others, it copies the email attachment into the case attachment module.
I keep the custom function in the entry_points directory though it's not strictly an entry point. A legacy choice I plan to improve in the near future.
There are probably better ways to do this now that Emails are sidecar. As I said this is a vintage piece of code from my early days of Sugar (2012) that I just have not gotten around to revising.
Francesca