Hi All,
I have been customizing form (CustTable) and have created a group in it . The group contains two fields from table (TaxInformationCustTable_IN) .
Now I have override the modiefiedvalue() method in (TaxInformationCustTable_IN). When I debug every thing goes well , I mean the flow is executing the line which will make / set the datasouce fields mandatory / allowedit property accordingly. But on form no effect is getting reflected , I mean the field's property on the form is getting changed neither getting mandatory not setting it's allow edit property.
please find the below code and let me know what am I committing wrong here:
public void modifiedFieldValue(FieldName _fieldName, int _arrayIndex = 1)
{
// Azelis -->
#isoCountryRegionCodes
TaxInformationCustTable_IN taxInfoCustTable;
boolean boolActive;
CustTable custDataSource;
FormBuildDataSource formBuildDataSource;
FormBuildDesign formBuildDesign;
FormRun formRun;
Args args = new Args();
Form form =new Form();
DictTable dicTableID = new DictTable(tableNum(TaxInformationCustTable_IN));
FormDataSource objFormDS = new FormDataSource();
super(_fieldName, _arrayIndex);
formBuildDataSource = form.addDataSource(dicTableID.name());
formBuildDataSource.table(dicTableID.id());
formBuildDesign = form.addDesign('Design');
args.object(form);
formRun = new FormRun(args);
formRun.run();
objFormDS = formRun.dataSource(1);
switch(_fieldName)
{
case fieldStr(TaxInformationCustTable_IN, AZ_UnauthorizedDealer):
if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoIN]))
{
if (this.AZ_UnauthorizedDealer == NoYes::Yes)
{
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_RegistrationNumber)).mandatory(false);
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_RegistrationNumber)).allowEdit(false);
this.AZ_RegistrationNumber = '';
}
else if (this.AZ_UnauthorizedDealer == NoYes::No)
{
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_RegistrationNumber)).mandatory(true);
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_UnauthorizedDealer)).allowEdit(false);
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_RegistrationNumber)).allowEdit(false);
}
}
break;
case fieldStr(TaxInformationCustTable_IN, AZ_RegistrationNumber):
if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoIN]))
{
if ( this.AZ_RegistrationNumber == ''
&& this.AZ_UnauthorizedDealer == NoYes::No)
{
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_RegistrationNumber)).mandatory(true);
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_RegistrationNumber)).allowEdit(true);
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_UnauthorizedDealer)).mandatory(true);
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_UnauthorizedDealer)).allowEdit(true);
}
else if (this.AZ_RegistrationNumber)
{
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_UnauthorizedDealer)).mandatory(false);
objFormDS.object(fieldNum(TaxInformationCustTable_IN, AZ_UnauthorizedDealer)).allowEdit(false);
this.AZ_UnauthorizedDealer = NoYes::No;
}
}
break;
}
// Azelis <--
}
*This post is locked for comments
I have the same question (0)