Its quite awkward to ask a newbie kind of question but can anyone help me on it.
I have an optionset field, Sales Stage, where I am capturing the stages of BPF, and I am hiding tabs based on option set values.
JS working fine on form OnLoad and same JS not working on field OnChange.
Please let me know where I went wrong.
function OnStageShangeHideShowTabs(executionContext)
{ debugger;
try{
var formContext = executionContext.getFormContext();
if(formContext.getAttribute("css_salesstage") !=null)
{
var OptionSetValue = formContext.getAttribute("css_salesstage").getValue();
if (OptionSetValue != null)
{
if (OptionSetValue == 862590003) //PO/Contract Stage
{
formContext.ui.tabs.get("tab_orders").setVisible(true);
formContext.ui.tabs.get("tab_Invoice").setVisible(false);
formContext.ui.tabs.get("tab_payments").setVisible(false);
}
else {
if (OptionSetValue == 862590004) //Invoice Stage
{
formContext.ui.tabs.get("tab_orders").setVisible(false);
formContext.ui.tabs.get("tab_Invoice").setVisible(true);
formContext.ui.tabs.get("tab_payments").setVisible(false);
}
else {
if (OptionSetValue == 862590005) //Payment Received Stage
{
formContext.ui.tabs.get("tab_orders").setVisible(false);
formContext.ui.tabs.get("tab_Invoice").setVisible(false);
formContext.ui.tabs.get("tab_payments").setVisible(true);
}
else {
formContext.ui.tabs.get("tab_orders").setVisible(false);
formContext.ui.tabs.get("tab_Invoice").setVisible(false);
formContext.ui.tabs.get("tab_payments").setVisible(false);
}
}
}
}
}
}catch(e)
{
alert("Error is in OnStageShangeHideShowTabs and error is: " +e);
}
}
*This post is locked for comments
I have the same question (0)