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

JScript to Show/Hide Sections on a form based on an Option Set value - troubleshoot

$
0
0

Hi all, 

Looking for help on some JScript.  Basically, I want to Show/Hide 4 sections on a form based on a field called 'Deal Stage' certain values:

Show/Hide Current LOI Document Attachments, Current Contract Document Attachments, Current Green Folder Document Attachments, Current Closing Memo Document Attachment Sections based on the corresponding Deal Stage OS values. 
Deal Stage = Pipeline LOI (531,180,000), Show Current LOI Document Attachments Section, else hide 
Deal Stage = Pipeline Contact (531,180,001), Show Current Contract Document Attachments Section, else hide 
Deal Stage = Not CIC Approved (531,180,002), Show Current GF Document Attachments Section, else hide 
Deal Stage = Closing (531,180,004), Show Current Closing Memo Document Attachments Section, else hide

Here is current code that I have that is throwing a "Web Resource Method does not exist" error onLoad/onChange of OS.  Hoping it is syntax or something simple.  Thanks in advance!  

function ShowHideDocAttachmentSections(ExecutionContext) {

var dealStage = formContext.getAttribute("lennar_dealstage").getValue();

var formContext = context.getFormContext();

}

{

var docTab = formContext.ui.tabs.get("tab_12");

}

if (dealStage) != (531, 180, 000) {

formContext.ui.sections.get("tab_12_section_6").setVisible(true);

}

else {

formContext.ui.sections.get("tab_12_section_6").setVisible(false);

}

if (dealStage) != (531, 180, 001) {

formContext.ui.sections.get("tab_12_section_7").setVisible(true);

}

else {

formContext.ui.sections.get("tab_12_section_7").setVisible(false);

}

if (dealStage) != (531, 180, 002) {

formContext.ui.sections.get("tab_12_section_8").setVisible(true);

}

else {

formContext.ui.sections.get("tab_12_section_8").setVisible(false);

}

if (dealStage) != (531, 180, 004) {


formContext.ui.sections.get("tab_12_section_9").setVisible(true);

}

else {

formContext.ui.sections.get("tab_12_section_9").setVisible(false);

}

}


Viewing all articles
Browse latest Browse all 79901

Trending Articles



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