1
votes

I have created a Sharepoint site and configured it in Dynamics 365 from "Document Management".

Then created an Account and a Lead in Dynamic 365. From Lead if I browse to "Documents", I can see Sharepoint location in which if I upload a document, it will reflect in Sharepoint Online. And if I upload document to entity of Lead in Sharepoint Online, that document can be browsed from Dynamics 365.

Now the question is I have to send a Email to that Lead, how can I add that sharepoint document as link or attachment to email? As there is no such option from Dynamics 365 to do so.

PS- I don't want to manually copy the link of document from Sharepoint-Online and paste it in email while composing in Dynamics-365.

1
It seems like you already know this - you need to build something custom. But describing that 'something' is too broad a question for SO (stackoverflow.com/help/closed-questions)James Wood
Can you suggest me some links which can help me understand the concept? Thanks.Hussain Champeli

1 Answers

0
votes

High level steps:

  1. You can register a plugin on pre-create of Email
  2. In that plugin query the RegardingObjectId of Email which is LeadId
  3. Query SharePointDocumentLocation entity using RetreiveMultiple by filtering RegardingObjectId = LeadId from step 2
  4. Compose & embed the Document url in Email body by concatenating Absolute url of Sharepoint site & Relative url of document location for each result in step 3

Reference.