none
Urgent : Extract and Show images from CRM Notes to an ASP.NET Page

    Question

  • Dear Sir,

    I have an Entity called Purchase. Each Record in Purchase has an Image related to the Item Code in that Purchase. This Image is saved as an Attachment in Notes for that Purchase.

    We are developing an external website (ASP.NET) from which the clients can see his Purchases in an ASP.NET control gridview.
    What I want is for each record in grid, there should be a link pointing towards that image, so that whenever the client clicks on the link he will get a option either to open/save the image.

    So, how do we extract and show images from Notes to an ASP.NET Page? Also, if you have any better solutions, plz let me know.

    Thanks,
    Abbas

    Thursday, April 01, 2010 1:34 PM

Answers

    • Marked as answer by Jim Glass Jr Thursday, April 01, 2010 3:35 PM
    Thursday, April 01, 2010 3:16 PM
    Moderator
  • CRM natively has a link to every attachment that you could use.  You could create a custom string attribute on your entity that maybe you can populate the attachment url with a plugin when an attachment is created for that entity.  Then your grid will just pull back that custom string attribute as a column and turn it into a link so the user can click on it to download the image just like when clicking on it from the notes tab.

    The attachment url looks something like:
    http://<server>/<org>/Activities/Attachment/download.aspx?AttachmentType=5&AttachmentId=<attachmentid>&IsNotesTabAttachment=1
    Thursday, April 01, 2010 3:30 PM

All replies

    • Marked as answer by Jim Glass Jr Thursday, April 01, 2010 3:35 PM
    Thursday, April 01, 2010 3:16 PM
    Moderator
  • CRM natively has a link to every attachment that you could use.  You could create a custom string attribute on your entity that maybe you can populate the attachment url with a plugin when an attachment is created for that entity.  Then your grid will just pull back that custom string attribute as a column and turn it into a link so the user can click on it to download the image just like when clicking on it from the notes tab.

    The attachment url looks something like:
    http://<server>/<org>/Activities/Attachment/download.aspx?AttachmentType=5&AttachmentId=<attachmentid>&IsNotesTabAttachment=1
    Thursday, April 01, 2010 3:30 PM
  • Dear Sir,

    When I type the following URL -

    http://crm/WEBClient/Activities/Attachment/download.aspx?AttachmentType=5&AttachmentId={B4C874AC-5B3D-DF11-BD50-001E9088EBB5}&IsNotesTabAttachment=1

    I get the follwoing Error -

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /WEBClient/Activities/Attachment/download.aspx


    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082

    Please suggest what should I do?

    Thanks - Abbas

    Monday, April 05, 2010 7:34 AM
  • Download Fiddler and navigate to your attachment in the CRM UI.  Run fiddler and then click on the link to your attachment in CRM and you can find the URL from fiddler.
    Blake Scarlavai - Sonoma Partners - http://www.sonomapartners.com/
    Monday, April 05, 2010 12:38 PM