web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to retrieve CRM Entity Metadata and Fields information in HTML Page ?

(0) ShareShare
ReportReport
Posted on by 1,442

Hi Everyone,

I have a requirement to show CRM Entity Metadata to show all Entities (Display Names) in a drop down and based on entity selection, it should show the list of fields (Display Names) in HTML form.

Example: Entities (Dropdown) - Contact

--------------------------------------------

First Name

Last Name

etc.,

--------------------------------------------

How can it be achieved ion HTML Page in CRM 2016?

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at
    RE: How to retrieve CRM Entity Metadata and Fields information in HTML Page ?

    Hi Arun,

    Yes you can retrieve metadata using JavaScript / C# code..

    here are some links

    C#

    msdn.microsoft.com/.../jj863599.aspx

    msdn.microsoft.com/.../microsoft.xrm.sdk.messages.retrieveentityrequest.aspx

    msdn.microsoft.com/.../jj863605.aspx

    JavaScript

    msdn.microsoft.com/.../jj919080(v=crm.6).aspx

    msdn.microsoft.com/.../gg594428(v=crm.7).aspx

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at
    RE: How to retrieve CRM Entity Metadata and Fields information in HTML Page ?

    Hi Arun Potti,

    I think you can perform this using Web API. You could write a Javascript code in the HTML web resource with WebAPI call. Please refer the link below.

    community.dynamics.com/.../597643

    Hope this gives you an idea.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: How to retrieve CRM Entity Metadata and Fields information in HTML Page ?

    Use Below Code:

    <html><head>
    <meta charset="utf-8">
    <style type="text/css">
           body
            {
                background-color : #FFFFFF;
    			font-family:Segoe UI, Tahoma, Arial;
    			font-size:11px;
            }
    dynamicForm{
    	overflow-y:scroll;
    }
    		td{
    	color: #3b3b3b;
    	font size=11px;
    text-align: center;
    	}
    		select{
    font-family:Segoe UI, Tahoma, Arial;
    			font-size:11px;
    valign:top;
    }
    .tablabel{
    		font-size:15px;
    		font-weight:bold;
    		color:#1261e1;
    		font-family:Segoe UI, Tahoma, Arial
    	}
    	
    	.sectionlabel{
    		font-size:13px;
    		font-weight:bold;
    		color:#3b3b3b;
    		font-family:Segoe UI, Tahoma, Arial
    	}
    
    .section{
    		margin-left: 15px;
    	}
    
    .attributeTable{
    		margin-left: 30px;
    	}
    
    </style>
    
    <script language="javascript" src="new_jquery_1.7.1.min.js" type="text/javascript"></script>
    
    <script type="text/javascript">
    
    function retrieveEntity() {
    	debugger;
        var serverURL = parent.Xrm.Page.context.getClientUrl();
        var Query = "EntityDefinitions?$select=DisplayName,EntitySetName,ObjectTypeCode";
        var req = new XMLHttpRequest();
        req.open("GET", serverURL + "/api/data/v8.2/" + Query, true);
        req.setRequestHeader("Accept", "application/json");
        req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
        req.setRequestHeader("OData-MaxVersion", "4.0");
        req.setRequestHeader("OData-Version", "4.0");
    	req.setRequestHeader("Prefer", "odata.include-annotations=*");
        req.onreadystatechange = function() {
            if (this.readyState == 4 /* complete */ ) {
                req.onreadystatechange = null;
                if (this.status == 200) {
                    var data = JSON.parse(this.response);
    				if(data!=null && data.value !=null){
    					var AllentityMetadataCollection = data.value; 
    					var entityMetadataCollection = [];
    						for(var i = 0; i <AllentityMetadataCollection.length; i++ ){
    							if(AllentityMetadataCollection[i].DisplayName && AllentityMetadataCollection[i].DisplayName.UserLocalizedLabel){
    									entityMetadataCollection[entityMetadataCollection.length] = AllentityMetadataCollection[i];
    							}
    						}
    						
    					entityMetadataCollection.sort(function (a, b) {
    					if (a.DisplayName.LocalizedLabels[0].Label < b.DisplayName.LocalizedLabels[0].Label)
    					{ return -1 }
    					if (a.DisplayName.LocalizedLabels[0].Label> b.DisplayName.LocalizedLabels[0].Label)
    					{ return 1 }
    					return 0;
    					});
    					
    					for (var i = 0; i < entityMetadataCollection.length; i++) {
    
    						var entity = entityMetadataCollection[i];
    						if($("#ddlallentity").length!=0){
    							if(entity.DisplayName.UserLocalizedLabel!=null){
    								$("#ddlallentity").append("<option value='"+entity.EntitySetName+"|"+entity.ObjectTypeCode+"|"+entity.MetadataId+"'>"+entity.DisplayName.LocalizedLabels[0].Label+"</option>");
    							}
    						}	
    						else{
    							$("#ddlallentity").change(function (){							
    							var entityName = $("#ddlallentity option:selected").text();
    							var entityLogicalName = $("#ddlallentity option:selected").val();
    							parent.Xrm.Page.getAttribute("new_entityname").setValue(entityLogicalName);
    							if($("#ddlattribute").length!=0){
    								$("#ddlattribute").empty()
    							}
    						
    							});		
    						}
    
    					}
    				}
                } else {
                    var error = JSON.parse(this.response).error;
                    alert(error.message);
                }
            }
        };
        req.send();
    }
    
    function setLogicalNameofEntity(){
    			var entityName = $("#ddlallentity option:selected").text();
    			var entLogicalName = $("#ddlallentity option:selected").val();
    			var entityLogicalName = $("#ddlallentity option:selected").val().split("|")[0];
    			var entityTypeCode = $("#ddlallentity option:selected").val().split("|")[1];
    			var entityMetadataId  = $("#ddlallentity option:selected").val().split("|")[2];
    			parent.Xrm.Page.getAttribute("new_entityname").setValue(entityLogicalName);
    			parent.Xrm.Page.getAttribute("new_entitytypecode").setValue(entityTypeCode);
    			parent.Xrm.Page.getAttribute("new_entitymetadataid").setValue(entityMetadataId);
    			
    			if($("#ddlattribute > option").length!=0){
    					$("#ddlattribute").empty();
    				$("#ddlattribute").css({
    					'min-width': '100px'
    				});
    
    			}
    			$('#dynamicForm').empty();
    
    			retrieveAttributes(attributesRetrieved,entityMetadataId);
    		}
    
    
    function retrieveAttributes(attributesRetrieved,entityMetadataId) {
        var serverURL = parent.Xrm.Page.context.getClientUrl();
        var Query = "EntityDefinitions("+ entityMetadataId.toUpperCase() +")?$select=LogicalName&$expand=Attributes($select=LogicalName,DisplayName)";
        var req = new XMLHttpRequest();
        req.open("GET", serverURL + "/api/data/v8.2/" + Query, true);
        req.setRequestHeader("Accept", "application/json");
        req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
        req.setRequestHeader("OData-MaxVersion", "4.0");
        req.setRequestHeader("OData-Version", "4.0");
    	req.setRequestHeader("Prefer", "odata.include-annotations=*");
        req.onreadystatechange = function() {
            if (this.readyState == 4 /* complete */ ) {
                req.onreadystatechange = null;
                if (this.status == 200) {
                    var data = JSON.parse(this.response);
    				if(data!=null && data.Attributes!=null){
    					
    					var AllAttributesCollection = data.Attributes; 
    					var attributesCollection = [];
    						for(var i = 0; i <AllAttributesCollection.length; i++ ){
    							if(AllAttributesCollection[i].DisplayName && AllAttributesCollection[i].DisplayName.UserLocalizedLabel){
    									attributesCollection[attributesCollection.length] = AllAttributesCollection[i];
    							}
    						}
    
    					attributesCollection.sort(function (a, b) {
    					if (a.DisplayName.LocalizedLabels[0].Label < b.DisplayName.LocalizedLabels[0].Label)
    					{ return -1 }
    					if (a.DisplayName.LocalizedLabels[0].Label> b.DisplayName.LocalizedLabels[0].Label)
    					{ return 1 }
    					return 0;
    					});
    					
    					for (var i = 0; i < attributesCollection.length; i++) {
    
    						var attribute = attributesCollection[i];
    						if($("#ddlattribute").length!=0){
    							if(attribute.DisplayName.UserLocalizedLabel!=null){
    								$("#ddlattribute").append("<option value='"+attribute.LogicalName+"'>"+attribute.DisplayName.LocalizedLabels[0].Label+"</option>");
    							}
    						}
    					}	
    				}
                } 
    			else {
                    var error = JSON.parse(this.response).error;
                    alert(error.message);
    			}
            }
        };
        req.send();
    }
    
     window.onload = retrieveEntity;
    
    </script>
    <meta></head>
    <body style="margin: 0px;">
    <table height="1%" class="ms-crm-FormSection" id="{91951bf5-186c-4bb4-8d0b-80c807212b46}" style="table-layout: fixed;" cellspacing="0" cellpadding="3" valign="top" control="[object Object]" columns="2" label="General" isviewportsection="0">
    <colgroup>
    <col width="120">
    <col>
    <col width="140" class="FormSection_WriteColumnHeaders_col">
    <col>
    </colgroup><tbody>
    <tr valign="top">
    <td title="Entity" class="ms-crm-FieldLabel-LeftAlign ms-crm-Field-Normal" id="ddlallentity_c" style="text-align: left; font-size: 11px; color: #3b3b3b;"><label for="ddlallentity">Entity</label></td>
    <td width="300" id="ddlallentity_d" isautoexpanding="FALSE" formxmlcolspan="1"><select name="ddlallentity" tabindex="1790" class="ms-crm-SelectBox " id="ddlallentity" style="float: left; -ms-ime-mode: auto; min-width: 100px;" onchange="setLogicalNameofEntity()"  attrpriv="7" attrname="ddlallentity" req="0" defaultselected="-1"></select></td>
    <td title="Field Name" class="ms-crm-FieldLabel-LeftAlign ms-crm-Field-Normal" id="ddlattribute_c" style="padding-left: 20px; font-size: 11px; color: #3b3b3b;"><label for="ddlattribute">Field Name</label></td>
    <td id="ddlattribute_d" isautoexpanding="FALSE" formxmlcolspan="1"><select name="ddlattribute" tabindex="1880" class="ms-crm-SelectBox " id="ddlattribute" style="-ms-ime-mode: auto; min-width: 100px;" attrpriv="7" attrname="ddlattribute" req="0" defaultselected="-1"></select></td></tr></tbody></table>
    <div id="dynamicForm"></div>
    <div id="iframediv" style="display: none;"><iframe id="MyFormIframe">
    </iframe></div></body></html>


  • Suggested answer
    Alagunellaikumar Profile Picture
    6,212 on at
    RE: How to retrieve CRM Entity Metadata and Fields information in HTML Page ?

    Hi

    Please refer the below URL

    msdn.microsoft.com/.../mt607522.aspx

  • Arun Potti Profile Picture
    1,442 on at
    RE: How to retrieve CRM Entity Metadata and Fields information in HTML Page ?

    Hi Akhtar,

    Thank you very much for the code.

    Is there any way to get the fields information placed on the Form only with Field Type, instead of all fields?

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to retrieve CRM Entity Metadata and Fields information in HTML Page ?

    Hi Arun,

    We can retrieve attributes of an entity on a form using SystemForm metadata. SystemForm has information of all the forms present on the Entity and also formxml which can be used to parse the field names present on the form. Refer below code:

    <html><head>
    <meta charset="utf-8">
    <style type="text/css">
           body
            {
                background-color : #FFFFFF;
    			font-family:Segoe UI, Tahoma, Arial;
    			font-size:11px;
            }
    dynamicForm{
    	overflow-y:scroll;
    }
    		td{
    	color: #3b3b3b;
    	font size=11px;
    text-align: center;
    	}
    		select{
    font-family:Segoe UI, Tahoma, Arial;
    			font-size:11px;
    valign:top;
    }
    .tablabel{
    		font-size:15px;
    		font-weight:bold;
    		color:#1261e1;
    		font-family:Segoe UI, Tahoma, Arial
    	}
    	
    	.sectionlabel{
    		font-size:13px;
    		font-weight:bold;
    		color:#3b3b3b;
    		font-family:Segoe UI, Tahoma, Arial
    	}
    
    .section{
    		margin-left: 15px;
    	}
    
    .attributeTable{
    		margin-left: 30px;
    	}
    
    </style>
    
    <script language="javascript" src="new_jquery_1.7.1.min.js" type="text/javascript"></script>
    
    <script type="text/javascript">
    
    function retrieveEntity() {
        var serverURL = parent.Xrm.Page.context.getClientUrl();
        var Query = "EntityDefinitions?$select=DisplayName,EntitySetName,ObjectTypeCode,LogicalName";
        var req = new XMLHttpRequest();
        req.open("GET", serverURL + "/api/data/v8.2/" + Query, true);
        req.setRequestHeader("Accept", "application/json");
        req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
        req.setRequestHeader("OData-MaxVersion", "4.0");
        req.setRequestHeader("OData-Version", "4.0");
    	req.setRequestHeader("Prefer", "odata.include-annotations=*");
        req.onreadystatechange = function() {
            if (this.readyState == 4 /* complete */ ) {
                req.onreadystatechange = null;
                if (this.status == 200) {
                    var data = JSON.parse(this.response);
    				if(data!=null && data.value !=null){
    					var AllentityMetadataCollection = data.value; 
    					var entityMetadataCollection = [];
    						for(var i = 0; i <AllentityMetadataCollection.length; i++ ){
    							if(AllentityMetadataCollection[i].DisplayName && AllentityMetadataCollection[i].DisplayName.UserLocalizedLabel){
    									entityMetadataCollection[entityMetadataCollection.length] = AllentityMetadataCollection[i];
    							}
    						}
    						
    					entityMetadataCollection.sort(function (a, b) {
    					if (a.DisplayName.LocalizedLabels[0].Label < b.DisplayName.LocalizedLabels[0].Label)
    					{ return -1 }
    					if (a.DisplayName.LocalizedLabels[0].Label> b.DisplayName.LocalizedLabels[0].Label)
    					{ return 1 }
    					return 0;
    					});
    					
    					for (var i = 0; i < entityMetadataCollection.length; i++) {
    
    						var entity = entityMetadataCollection[i];
    						if($("#ddlallentity").length!=0){
    							if(entity.DisplayName.UserLocalizedLabel!=null){
    								$("#ddlallentity").append("<option value='"+entity.EntitySetName+"|"+entity.ObjectTypeCode+"|"+entity.MetadataId+"|"+entity.LogicalName+"'>"+entity.DisplayName.LocalizedLabels[0].Label+"</option>");
    							}
    						}	
    						else{
    							$("#ddlallentity").change(function (){							
    							var entityName = $("#ddlallentity option:selected").text();
    							var entityLogicalName = $("#ddlallentity option:selected").val();
    							parent.Xrm.Page.getAttribute("new_entityname").setValue(entityLogicalName);
    							if($("#ddlallForms").length!=0){
    								$("#ddlallForms").empty()
    							}
    							if($("#ddlattribute").length!=0){
    								$("#ddlattribute").empty()
    							}
    						
    							});		
    						}
    
    					}
    					selectValueonLoad();
    
    				}
                } else {
                    var error = JSON.parse(this.response).error;
                    alert(error.message);
                }
            }
        };
        req.send();
    }
    
    function setLogicalNameofEntity(){
    
    			var entityName = $("#ddlallentity option:selected").text();
    			var entLogicalName = $("#ddlallentity option:selected").val();
    			var entityLogicalName = $("#ddlallentity option:selected").val().split("|")[0];
    			var entityTypeCode = $("#ddlallentity option:selected").val().split("|")[1];
    			var entityMetadataId  = $("#ddlallentity option:selected").val().split("|")[2];
    			var entityLogicalName1 = $("#ddlallentity option:selected").val().split("|")[3];
    			parent.Xrm.Page.getAttribute("new_entityname").setValue(entityLogicalName);
    			parent.Xrm.Page.getAttribute("new_entitytypecode").setValue(entityTypeCode);
    			parent.Xrm.Page.getAttribute("new_entitymetadataid").setValue(entityMetadataId);
    			
    			if($("#ddlattribute > option").length!=0){
    					$("#ddlattribute").empty();
    				$("#ddlattribute").css({
    					'min-width': '100px'
    				});
    
    			}
    			if($("#ddlallForms > option").length!=0){
    					$("#ddlallForms").empty();
    				$("#ddlallForms").css({
    					'min-width': '100px'
    				});
    
    			}
    			$('#dynamicForm').empty();
    				var attributesRetrieved = false;
    				retrieveForms(entityLogicalName1,entityMetadataId);
    			// retrieveAttributes(attributesRetrieved,entityMetadataId);
    		}
    
    function setFormNameofEntity(){
    
    			var FormName = $("#ddlallForms option:selected").text();
    			var entityMetadataId = $("#ddlallForms option:selected").val().split("|")[0];
    			var formid = $("#ddlallForms option:selected").val().split("|")[1];
    			retrieveFormsXml(formid);
    			var FormXml = parent.Xrm.Page.getAttribute("new_formxml");
    
    			if($("#ddlattribute > option").length!=0){
    					$("#ddlattribute").empty();
    				$("#ddlattribute").css({
    					'min-width': '100px'
    				});
    			}
    
    			$('#dynamicForm').empty();
    				var attributesRetrieved = false;
    				retrieveAttributes(attributesRetrieved,entityMetadataId);
    		}
    
    
    function retrieveForms(ObjectTypeCode,entityMetadataId){
    var req = new XMLHttpRequest();
    req.open("GET", parent.Xrm.Page.context.getClientUrl() + "/api/data/v8.2/systemforms()?$select=formid,name,objecttypecode,formxml,type&$filter=objecttypecode eq '"+ObjectTypeCode+"' and formactivationstate eq 1 and (type eq 2 or type eq 5 or type eq 6 or type eq 7 or type eq 11 or type eq 12)", true);
    req.setRequestHeader("OData-MaxVersion", "4.0");
    req.setRequestHeader("OData-Version", "4.0");
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
    req.onreadystatechange = function() {
        if (this.readyState === 4) {
            req.onreadystatechange = null;
            if (this.status === 200) {
                var data = JSON.parse(this.response);
    			if(data!=null && data.value !=null){
    					var AllentityFormCollection = data.value; 
    					
    					var entityFormCollection = [];
    						for(var i = 0; i <AllentityFormCollection.length; i++ ){
    							if(AllentityFormCollection[i].name){
    									entityFormCollection[entityFormCollection.length] = AllentityFormCollection[i];
    							}
    						}
    						
    					entityFormCollection.sort(function (a, b) {
    					if (a.name < b.name)
    					{ return -1 }
    					if (a.name> b.name)
    					{ return 1 }
    					return 0;
    					});
    					
    					for (var i = 0; i < entityFormCollection.length; i++) {
    
    					var form = entityFormCollection[i];
    					
    						if($("#ddlallForms").length!=0){
    							if(form.name!=null){
    								
    								$("#ddlallForms").append("<option value='"+entityMetadataId+"|"+form.formid+"'>"+form.name+"|"+form['type@OData.Community.Display.V1.FormattedValue']+"</option>");
    							}
    						}
    					}
    					}
            } else {
                Xrm.Utility.alertDialog(this.statusText);
            }
        }
    };
    req.send();
    }
    
    function retrieveFormsXml(formid){
    var req = new XMLHttpRequest();
    req.open("GET", parent.Xrm.Page.context.getClientUrl() + "/api/data/v8.2/systemforms()?$select=formxml&$filter=formid eq "+formid.toUpperCase() , true);
    req.setRequestHeader("OData-MaxVersion", "4.0");
    req.setRequestHeader("OData-Version", "4.0");
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
    req.onreadystatechange = function() {
        if (this.readyState === 4) {
            req.onreadystatechange = null;
            if (this.status === 200) {
                var data = JSON.parse(this.response);
    			if(data!=null && data.value[0] !=null){
    					var form = data.value[0]; 
    						if(form.formxml!=null){
    							parent.Xrm.Page.getAttribute("new_formxml").setValue(form.formxml);
    						}
    					}
            } else {
                Xrm.Utility.alertDialog(this.statusText);
            }
        }
    };
    req.send();
    }
    
    function retrieveAttributes(attributesRetrieved,entityMetadataId) {
        var serverURL = parent.Xrm.Page.context.getClientUrl();
        var Query = "EntityDefinitions("+ entityMetadataId.toUpperCase() +")?$select=LogicalName&$expand=Attributes($select=LogicalName,DisplayName)";
        var req = new XMLHttpRequest();
        req.open("GET", serverURL + "/api/data/v8.2/" + Query, true);
        req.setRequestHeader("Accept", "application/json");
        req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
        req.setRequestHeader("OData-MaxVersion", "4.0");
        req.setRequestHeader("OData-Version", "4.0");
    	req.setRequestHeader("Prefer", "odata.include-annotations=*");
        req.onreadystatechange = function() {
            if (this.readyState == 4 /* complete */ ) {
                req.onreadystatechange = null;
                if (this.status == 200) {
                    var data = JSON.parse(this.response);
    				if(data!=null && data.Attributes!=null){
    					
    					var AllAttributesCollection = data.Attributes; 
    					var attributesCollection = [];
    						for(var i = 0; i <AllAttributesCollection.length; i++ ){
    							if(AllAttributesCollection[i].DisplayName && AllAttributesCollection[i].DisplayName.UserLocalizedLabel){
    									attributesCollection[attributesCollection.length] = AllAttributesCollection[i];
    							}
    						}
    
    					attributesCollection.sort(function (a, b) {
    					if (a.DisplayName.LocalizedLabels[0].Label < b.DisplayName.LocalizedLabels[0].Label)
    					{ return -1 }
    					if (a.DisplayName.LocalizedLabels[0].Label> b.DisplayName.LocalizedLabels[0].Label)
    					{ return 1 }
    					return 0;
    					});
    					
    					var formxml = parent.Xrm.Page.getAttribute("new_formxml");
    					for (var i = 0; i < attributesCollection.length; i++) {
    						var attribute = attributesCollection[i];
    						if(formxml && formxml.getValue() != null)
    						if($("#ddlattribute").length!=0){
    						attribute.LogicalName
    							if(attribute.DisplayName.UserLocalizedLabel!=null && attribute.LogicalName!=null && formxml.getValue().search(attribute.LogicalName) !== -1){
    								$("#ddlattribute").append("<option value='"+attribute.LogicalName+"'>"+attribute.DisplayName.LocalizedLabels[0].Label+"</option>");
    							}
    						}
    						}
    					}	
                } 
    			else {
                    var error = JSON.parse(this.response).error;
                    alert(error.message);
    			}
            }
        };
        req.send();
    }
    
     window.onload = retrieveEntity;
    
    </script>
    <meta></head>
    <body style='margin: 0px;'>
    <table height='1%' class='ms-crm-FormSection' id='{91951bf5-186c-4bb4-8d0b-80c807212b46}' style='table-layout: fixed;' cellspacing='0' cellpadding='3' valign='top' isviewportsection='0' label='General' columns='2' control='[object Object]'>
    <colgroup>
    <col width='120'>
    <col>
    <col width='140' class='FormSection_WriteColumnHeaders_col'>
    <col>
    </colgroup><tbody>
    <tr valign='top'>
    <td title='Entity' class='ms-crm-FieldLabel-LeftAlign ms-crm-Field-Normal' id='ddlallentity_c' style='text-align: left; color: rgb(59, 59, 59); font-size: 11px;'><label for='ddlallentity'>Entity</label></td>
    <td width='300' id='ddlallentity_d' formxmlcolspan='1' isautoexpanding='FALSE'><select name='ddlallentity' tabindex='1790' class='ms-crm-SelectBox ' id='ddlallentity' style='float: left; -ms-ime-mode: auto; min-width: 100px;' onchange='setLogicalNameofEntity()' defaultselected='-1' req='0' attrname='ddlallentity' attrpriv='7'></select></td>
    <td title='Form Name' class='ms-crm-FieldLabel-LeftAlign ms-crm-Field-Normal' id='ddlallForms_c' style='text-align: left; color: rgb(59, 59, 59); font-size: 11px;'><label for='ddlallForms'>Form Name</label></td>
    <td width='300' id='ddlallForms_d' formxmlcolspan='1' isautoexpanding='FALSE'><select name='ddlallForms' tabindex='1790' class='ms-crm-SelectBox ' id='ddlallForms' style='float: left; -ms-ime-mode: auto; min-width: 100px;' onchange='setFormNameofEntity()' defaultselected='-1' req='0' attrname='ddlallForms' attrpriv='7'></select></td>
    <td title='Field Name' class='ms-crm-FieldLabel-LeftAlign ms-crm-Field-Normal' id='ddlattribute_c' style='color: rgb(59, 59, 59); padding-left: 20px; font-size: 11px;'><label for='ddlattribute'>Field Name</label></td>
    <td id='ddlattribute_d' formxmlcolspan='1' isautoexpanding='FALSE'><select name='ddlattribute' tabindex='1880' class='ms-crm-SelectBox ' id='ddlattribute' style='-ms-ime-mode: auto; min-width: 100px;' onchange='setIdOfAttribute()' defaultselected='-1' req='0' attrname='ddlattribute' attrpriv='7'></select></td></tr></tbody></table>
    <div id='dynamicForm' style='font-family: undefined;'></div>
    <div id='iframediv' style='font-family: undefined; display: none;'><iframe id='MyFormIframe'>
    </iframe></div></body></html>
  • Amrutha B K Profile Picture
    233 on at
    RE: How to retrieve CRM Entity Metadata and Fields information in HTML Page ?

    i tried the above code,i am getting only the entity name in the dropdown  based on the entity name not able to filter the field name,through this code how to filter the Attribute based on the entity,please suggest me.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans