Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8612529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:38:59+00:00 2026-06-12T04:38:59+00:00

How to show annotation present in an entity in popup window by using html

  • 0

How to show annotation present in an entity in popup window by using html web resource. My requirement is to display annotation present in an entity in a popup window and in popup window user should be able to delete , upload and convert the annotation to pdf (if he wants). Can you suggest a best method to achieve this in crm 2011.

function retann() {
//debugger;

var serverUrl = Xrm.Page.context.getServerUrl();

var GUIDvalue = Xrm.Page.data.entity.getId();

// Creating the Odata Endpoint
var oDataPath = "http://url/organization/XRMServices/2011/OrganizationData.svc/";
var retrieveReq = new XMLHttpRequest();
var Odata = oDataPath + "/AnnotationSet?$select=DocumentBody,FileName,MimeType,ObjectId&$filter=ObjectId/Id eq guid'" + GUIDvalue + "'";
retrieveReq.open("GET", Odata, false);
retrieveReq.setRequestHeader("Accept", "application/json");
retrieveReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
retrieveReq.onreadystatechange = function () { retrieveReqCallBack(this); };
retrieveReq.send(); 
}


function retrieveReqCallBack(retrieveReq) {
if (retrieveReq.readyState == 4 /* complete */) {

//debugger;

    var retrieved = this.parent.JSON.parse(retrieveReq.responseText).d;

    var message = "";
    var fun_var =
    "<script type=text/javascript>" +
    "function result_value()" +
    "{" +
    "var rad_val;" +
    "for (var i=0; i < document.orderform.test.length; ++i){if (document.orderform.test[i].checked){rad_val = document.orderform.test[i].value;}}" +
    "if(rad_val==null || rad_val=='')" +
    "{" +
    "window.top.opener.Xrm.Page.data.entity.attributes.get('new_radiovalue').setValue('0');" +
     "}" +
    "else" +
    "{" +
    "window.top.opener.Xrm.Page.data.entity.attributes.get('new_radiovalue').setValue(rad_val);" +
    "}" +
     " window.top.opener.Xrm.Page.data.entity.attributes.get('new_fireplugin').setValue(1);" +
     "window.top.opener.Xrm.Page.data.entity.save();" +
    "this.window.close();" +
    "}" +
    "function result_value1()" +
    "{" +
    "var rad_val1;" +
    "for (var i=0; i < document.orderform.test.length; ++i){if (document.orderform.test[i].checked){rad_val1 = document.orderform.test[i].value;}}" +
    "if(rad_val1==null || rad_val1=='')" +
    "{" +
    "window.top.opener.Xrm.Page.data.entity.attributes.get('new_radiovalue').setValue('0');" +
     "}" +
    "else" +
    "{" +
    "window.top.opener.Xrm.Page.data.entity.attributes.get('new_radiovalue').setValue(rad_val1);" +
    "}" +
     " window.top.opener.Xrm.Page.data.entity.attributes.get('new_delete').setValue(1);" +
     "window.top.opener.Xrm.Page.data.entity.save();" +
    "this.window.close();" +
    "}" +
    "</script>";

    var n = retrieved.results.length;
    for (var i = 0; i < retrieved.results.length; i++) {
        message += " <input type='radio' name='test' value=' " + i + "' />" + retrieved.results[i].FileName + "<br />";
    }
    myWindow = window.open('', '', 'width=500,height=150,left=250,top=250,scrollbars=yes,resizable=yes,directories=yes');
    myWindow.document.write(fun_var + "<body bgcolor=GhostWhite style='font-family:verdana;font-size:11px;'><form name='orderform' style='font-family:verdana;font-size:11px;'>" + message + "</br><center ><input type='button' onclick='result_value()' style='font-family:verdana;font-size:11px;' value='Convert To PDF'/></center>" + "</form>");
    myWindow.focus();

}
}


function SetField() {
var AddressType = Xrm.Page.data.entity.attributes.get("new_radiovalue");
AddressType.setValue("");
}


function save_form() {

// var MainPhone = Xrm.Page.data.entity.attributes.get("new_name").getValue(); 
//Xrm.Page.data.entity.attributes.get("new_name").setValue(MainPhone+"."); 
Xrm.Page.data.entity.save();

}

retrieveReqCallBack(this) function displays the popup with annoatation. Using the above code i’m able to convert doc to pdf. Since i want to add multiple functionalities like upload , delete and convert to pdf. If annotation is present then popup should have option to upload and if annotation is present then it has to show delete and convert to pdf buttons.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:39:00+00:00Added an answer on June 12, 2026 at 4:39 am

    I found this as solution to my question,
    You’ll need to create a custom web resource (html) with javascript to pull the data out of the sub-grid, parse the rows, query the crm data via REST or SOAP to see if there is an annotation, then put an icon of the ‘paperclip’ which’ll allow users to upload attachments against that record.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Warm greetings, I'm using the below code to show an annotation on an iOS
I want show annotation view (above one of my pin) after load map. For
Is it possible to show the typical iPhone maps annotation/callout bubble (MKAnnotation), on something
inside show.js.erb $('#viewport').html(<%= escape_javascript(render('show')) %>); I am trying to render the show view into
Please show me how i should correctly execute system proccess in java. I would
YQL SHOW TABLES has CSV and HTML. What about a table for Apache access
I am using annotation based validation but for one of the forms I am
I m using MkMapView with google maps.I succeed to show map view and address
I am building an application where I am using CorePlot libraries to show graphs.
Im trying to show a callout when user taps on an overlay. The callout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.