I have already tried to do this by adding an extension to the "Contract Class" in the AOT, and it was successful as this parameter was displayed during the execution of this report in the Output Menu. However, when I try to program this parameter in the UIBuilder Class so that I fill this parameter with specific values through a query, I face an error message that appears as "Value cannot be null. Parameter name: key". My Contract Class:
[ExtensionOf(classStr(LedgerTransStatementContract))]
final class LedgerTransStatementContract_Sitcom_Extension
{
public List DataAreas;
[
DataMemberAttribute('DataAreas'),
AifCollectionTypeAttribute('DataAreas', Types::String),
SysOperationLabelAttribute(literalStr("Data Area")),
SysOperationDisplayOrderAttribute('1')
]
public List parmDataAreas(List _DataAreas = DataAreas)
{
DataAreas = _DataAreas;
return DataAreas;
}
}
My UIBuilder Class:
[ExtensionOf(classStr(LedgerTransStatementUIBuilder))\]
final class LedgerTransStatementUIBuilder_Sitcom_Extension
{
public DialogField dialogDataArea;
public LedgerTransStatementContract_Sitcom_Extension contract;
public void postBuild()
{
next postBuild();
contract = this.dataContractObject() as LedgerTransStatementContract_Sitcom_Extension;
dialogDataArea = this.bindInfo().getDialogField(contract, methodStr(LedgerTransStatementContract_Sitcom_Extension, parmDataAreas));
dialogDataArea.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(LedgerTransStatementUIBuilder_Sitcom_Extension, GetDataArea), this);
if(dialogDataArea)
{
dialogDataArea.lookupButton(2);
}
}
private void GetDataArea(FormStringControl _control)
{
Query query = new query();
QueryBuildDataSource qbds = query.addDataSource(tableNum(CompanyInfo));
qbds.fields().dynamic(false);
qbds.fields().clearFieldList();
qbds.addSelectionField(fieldNum(CompanyInfo, DataArea));
SysLookupMultiSelectGrid::lookup(query,_control, _control, _control, conNull());
}
}
I have tried many methods to solve the problem, such as adding a parameter to the report or creating a Contract Class and a UIBuilder Class and making them inherit from the original report class, but I don't get anything.