简体   繁体   中英

How to convert a text line in text box in MS CRM 2011 to hyperlink

I already have code which is given below

var input = document.getElementById("documentlink");
input.style.color = "blue";
input.style.textDecoration = "underline";


input.onclick = function () {
   if (Xrm.Page.getAttribute("documentlink").getValue() != null)
        window.open(Xrm.Page.getAttribute("documentlink").getValue());
}

but the problem here is I cannot use html DOM since it can become an issue in upgradation as custom code validation tool identifies textDecoration as an issue. I cannot make that text box format to URL as that gives absolute URL and I am not allowed to change the types of existing fields. If there is any method to do this then please help.

Yes, There are a lot of ways to accomplish your goal:

  1. You can add ribbon button by clicking on which url would be opened.
  2. You can create your custom html webresource what can store/read information in/from your field and has required formatting. Shortly about development of Html/Js webresources and embedding it to your crm form you can read here - http://a33ik.blogspot.com/2015/03/howto-htmljs-webresources.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM