InventDimControl_Form enable selected fields

Updates the controls in the user interface, such as a form or report, by using the current  parameter values.
This method hides or shows controls. It is also responsible for enabling and disabling controls.
public void updateControls()
{
InventDimFormControlInterface fc;

if (formHasMethodUpdateControls == UnknownNoYes::Unknown)
{
formHasMethodUpdateControls = callingElement.hasMethod(identifierStr(updateControls)) ? UnknownNoYes::Yes : UnknownNoYes::No;
}

if (formHasMethodUpdateControls == UnknownNoYes::Yes)
{
callingElement.formObject().updateControls();
}

if (enabledToggle.empty() && visibleToggle.empty() && mandatoryToggle.empty())
{
return;
}

for (fc = inventDimControls.first(); fc; fc = inventDimControls.next())
{
if (enabledToggle.in(fc))
{
Added by me –> Begin
if(inventDimControls.fieldId(fc) == 6 || inventDimControls.fieldId(fc) == 16)
{
fc.allowEdit(true);
}
else
{
fc.allowEdit(!fc.allowEdit());
}
Added by me –> End
//fc.allowEdit(!fc.allowEdit()); //COMMENTED
}

if (visibleToggle.in(fc))
{
fc.visible(!fc.visible());
}

if (mandatoryToggle.in(fc))
{
fc.mandatory(!fc.mandatory());
}
}

if (formHasMethodUpdatedControls == UnknownNoYes::Unknown)
{
formHasMethodUpdatedControls = callingElement.hasMethod(identifierStr(inventDimCtrl_UpdatedControls)) ? UnknownNoYes::Yes : UnknownNoYes::No;
}

if (formHasMethodUpdatedControls == UnknownNoYes::Yes)
{
callingElement.formObject().inventDimCtrl_UpdatedControls();
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s