Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 123975

Forum Post: RE: Custom look up field in Opportunities

$
0
0

Hi,

In theory - you could add an two value optionset, with the values Account and Contact, then add a JavaScript webresource with something like:

var crm= crm || {};

crm.myForm= {

   onload  : function () {

       // Register onchange handlers

       Xrm.Page.getAttribute("new_lookuptype").addOnChange(crm.myForm.onLookupTypeChange);

       crm.myform.onLookupTypeChange();

   },

   onLookupTypeChange: function () {

       var attributeValue = Xrm.Page.getAttribute("new_lookuptype").getValue();

       Xrm.Page.getControl("new_accountid").setVisible(attributeValue );

       Xrm.Page.getControl("new_contactid").setVisible(!attributeValue);

   }

};

Then add an onload webresource event that calls crm.myForm.onload

hth


Viewing all articles
Browse latest Browse all 123975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>