Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Need help debugging jscript event that shows/hides sections based on Opportunity Scope field

$
0
0

I am trying to use a jscript event to show/hide tabs on my Opportunity form based on what is selected in the "Opportunity Scope".  I have made this an OnLoad event, as well as an "OnChange" event for when the Opportunity Scope field is changed.  However, I haven't been able to get the event to work.  I am fairly new to javascript and could use some help debugging.

Here is my code:

function HideShowOpportunityTabs()
{
OppScope = Xrm.Page.getAttribute(“new_OpportunityScope”);
if (OppScope.getValue() != null)
{
if(OppScope.getText()==”Product”)
{
Xrm.Page.ui.tabs.get(“RecurringRevenue”).setVisible(false);
Xrm.Page.ui.tabs.get(“FieldService”).setVisible(false);
}
else if (OppScope.getText()==”Professional Services”)
{
Xrm.Page.ui.tabs.get(“RecurringRevenue”).setVisible(true);
Xrm.Page.ui.tabs.get(“FieldService”).setVisible(true);
}
}
}

When I load the form, I receive the following error:

The "OnChange" event is not working either.  It does not cause an error, but the sections are not being hidden.

Any help fixing this would be greatly appreciated.  Thanks!


Viewing all articles
Browse latest Browse all 79901

Trending Articles



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