[FormControlEventHandler(formControlStr(VendParameters, VendParameters_YNV_VendorMasterDeletionOption), FormControlEventType::Modified)]
public static void VendParameters_YNV_VendorMasterDeletionOption_OnModified(FormControl sender, FormControlEventArgs e)
{
VendParameters vendParameters;
FormCheckBoxControl formCheckBoxControl = sender as FormCheckBoxControl;
ttsBegin;
while select
forUpdate crossCompany
YNV_VendorMasterDeletionOption,DataAreaId
from
vendParameters where vendParameters.DataAreaId != curExt()
{
changeCompany(vendParameters.dataAreaId)
{
vendParameters.YNV_VendorMasterDeletionOption = formCheckBoxControl.checked();
vendParameters.update();
}
}
ttsCommit;
}
====================
[ExtensionOf(FormDataSourcestr(VendTable, VendTable))]
final class YNV_VendTableFormDatasource_Extension
{
public int active()
{
int ret = next active();
VendTable vendTable = this.cursor();
boolean validate;
VendParameters vendParameters = VendParameters::find();
#SysSystemDefinedButtons
FormCommandButtonControl delete =this.formRun().control(this.formRun().controlId(#SystemDefinedDeleteButton)) as FormCommandButtonControl;
if (!Global::isSystemAdministrator() && vendParameters.YNV_VendorMasterDeletionOption)
{
delete.enabled(NoYes::No);
}
else
{
delete.enabled(NoYes::Yes);
}
=================================================
OutPut:-
No comments:
Post a Comment