Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Create a Note and an Attachment based on an URL

Posted on by 350

Hi, in a Dynamics CRM 2016 OnPremise (ADFS and IFD have already been implemented) we have a form which collects latitude and longitude values while being executed in the Dynamics 365 mobile app and it store them in a custom entity. It works fine and values are correctly saved in their fields. Based on those values, we internally build an URL so it points to a Google Maps static map and store the URL itself in a field on the form. If you click on it, the map and the location is correctly displayed in an Internet browser. 

Now, our customer is requesting to create a Note in each record with the static map image (the one you can access clicking on the URL field) as an attachment. This process needs to be performed as the final step of the process (1: collect the coordinates, 2: create the URL 3: create the note with the attachment)  of creating, updating the record in the custom entity. Users of the mobile app will only have Internet access in their mobile devices and not at their workplace desktops.

Do you have an idea if this is possible? Because of the requirement I assume a plugin need to be developed and in this case I would appreciate your help point me to some code I can analyze.

Regards,

Xavier

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create a Note and an Attachment based on an URL

    Check this link. This is in JavaScript but you can do the same in C#. With a little it more work, I hope you will be able to achieve it.

    www.aspsnippets.com/.../Export-Convert-Google-Maps-to-Image-using-Google-Maps-API-V3-Static-Maps-API.aspx

  • Emre GULCAN Profile Picture
    Emre GULCAN 2,379 on at
    RE: Create a Note and an Attachment based on an URL

    Hi Xavier,

    Maybe you should try take a screenshot (with code) when you create your map url. There are several service or code examples (native or with component) and I think they can help you.

    For your steps; when you create a record (on custom entity) with coordinate values, create a url (use codebehind / plugin - workflow) and after get valid url request to this url and get html response. this will be string response with all html.

    but if you use some "grabbing" components, you can take screenshot of this url.

    after that you can save it in notes that related with your custom record

  • Xavier Villafuerte Profile Picture
    Xavier Villafuerte 350 on at
    RE: Create a Note and an Attachment based on an URL

    Thanks, but that does not solve the problem. The main issue is my customer employees have a really tight Internet access policy and they do not have access to it from computers inside the company campus. What if I call the URL pointing to the static map from a SSRS report as en embedded image? Do you know where the call to the static map URL come from? From the SSRS server maybe?

  • Thomas David Dayman Profile Picture
    Thomas David Dayman 11,323 on at
    RE: Create a Note and an Attachment based on an URL

    I'm not sure about how to complete all your requirements but I do know how to add a HTML Attachment with a link in the Notes

    You will need to add the HTML code in the documentbody of the Note:

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="refresh"content='0; url=URL'/>
    </head>
    <body>
    </body>
    </html>


    The URL should be whatever your link should be. Then when ever a user clicks the attachment it will download the html and open the link on the browser.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans