This is an example for enabling and disabling of button1 and button2 on basis of caller form
Public void buttonEnable()
{
UserGroupList userGroupList,userGroupList1;
ProjParameters projParameters;
formRun caller;
;
caller = element.args().caller(); // caller form
if(caller.args().name() == formStr(ProjTable)) // caller form name
{
projParameters = ProjParameters::find();
// Checking that the CurUserId() is there of one particular group or not
Select userGroupList where userGroupList.UserId == curUserId()
if(userGroupList)
{
Button1.enabled( true);
}
else
{
Button1.enabled( false);
}
Select userGroupList1 where userGroupList1.UserId == curUserId()
if(userGroupList1)
{
Button2.enabled(true);
}
else
{
Button2.enabled(false);
}
}
if(caller.args().name() == formStr(ProjQuoteTable))
{
projParameters = ProjParameters::find();
Select userGroupList where userGroupList.UserId == curUserId()
if(userGroupList)
{
Button1.enabled( true);
}
else
{
Button1.enabled( false);
}
Select userGroupList1 where userGroupList1.UserId == curUserId()
if(userGroupList1)
{
Button2.enabled(true);
}
else
{
Button2.enabled(false);
}
}
}
No comments:
Post a Comment