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

Forum Post: RE: Making a Field Mandatory in an Opportunity

$
0
0

You would need to use JavaScript to accomplish something like this. Binding the OnChange events of the 2 fields as well as the Forms's OnLoad event.

Here is some example code:

function BidBond_OnChange() {     SetRequired(); }  function AgreementToBond_OnChange() {     SetRequired(); }  function Form_OnLoad() {     if (Xrm.Page.ui.getFormType() == 2) {         SetRequired();     } }  function SetRequired() {     var bidBond = Xrm.Page.getAttribute("new_bidbond").getValue();     var agreeBond = Xrm.Page.getAttribute("new_agreementtobond").getValue();      if (bidBond != null && agreeBond != null) {         if (bidBond == true || agreeBond == true) {             Xrm.Page.getAttribute("new_bondpayable").setRequiredLevel("required");             return;         }     }     Xrm.Page.getAttribute("new_bondpayable").setRequiredLevel("none"); } 

Viewing all articles
Browse latest Browse all 123975

Trending Articles



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