Articles

Affichage des articles du novembre, 2019

Decode/render HTML from a field in crm dynamics

In email entity the Hmtl is well decode. but if you want to decode it in other entity, it will not work you will just see the tag everywhere then I propose you to create a webressource and to apply this code. as you can see the field to to decode is hard coded but you can also give it as a webressource parameter. in a old post I explain how to pass value here is the html + javascript <html><head><meta></head> <body onload="onLoad()" onfocusout="parent.setEmailRange();" style="overflow-wrap: break-word;"> <script > function onLoad() { debugger; var para = document.createElement("decodedDescription"); var descriptionHtml = window.parent.Xrm.Page.getAttribute("description").getValue(); para.innerHTML = descriptionHtml; document.getElementById("decodedDescription").appendChild(para); }   </script > <div id="decodedDescription"> </div> </body></ht

make code wait for async 8.2

The async function to wait function getSetting (settingName) { var req = new XMLHttpRequest(); return new Promise(function (resolve, reject) {     // Setup our listener to process compeleted requests     req.onreadystatechange = function () {         // Only run if the request is complete         if (req.readyState !== 4) return;         // Process the response         if (req.status >= 200 && req.status < 300) {             // If successful             resolve             ( req      );         } else {             // If failed             reject(                 alert ("multiple setting with the name :" + settingName)             );         }     }; req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/query, false); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Accept", "appli

Add clickable button in the form

I do it via webressource <html><head>     <style>       * {                     margin: 0;                     padding: 0;                 }                                 .button{                     background-color: #00B3D9;                     color: #FFFFFF;                     font-family: Segoe UI, Tahoma, Arial;                     font-size: 14px;                     padding: 5px 10px 5px 10px;                     margin: 0px 4px 3px 1px;                     width: 100px;                     text-overflow: ellipsis;                     display: inline-block;                     text-align: center;                     overflow: hidden;                     white-space: nowrap;                     border-radius: 16px;                     border :none;                     float : left;                     border-bottom : none;                 }     </style>     <meta><meta><meta></head>         <bod