Hi,
I'm trying to extend SAFT Report by a multi select lookup parameter. I did add a list in extended contract class, yet the lookup shows with no options to pick.
What is might be the problem here?
[ DataContractAttribute, SysOperationContractProcessingAttribute(classStr(SAFTReportSZMUI)) ] [ExtensionOf(classStr(SAFTReportContract_Base_W))] final class SAFTReportContract_Base_W_SZM_Extension { private NoYes selectedWH; private List multiLocationId; [ DataMember('Czy zakolejkować magazyny?'), SysOperationGroupMember('Warehouse'), SysOperationDisplayOrder('2') ] public NoYes parmSelectedWarehouses(NoYes _selectedWH = selectedWH) { selectedWH = _selectedWH; return selectedWH; } [ DataMember('WarehouseMultiselect'), SysOperationGroupMember('Warehouse'), SysOperationDisplayOrder('3'), AifCollectionType('WarehouseMultiselect', Types::String, extendedTypeStr(InventLocationId)) ] public List parmInventLocationIdMulti(List _multiLocationId = multiLocationId) { multiLocationId = _multiLocationId; return multiLocationId; } }
class SAFTReportSZMUI extends SysOperationAutomaticUIBuilder { FormStringControl custGroupRecIdsControl; #define.InventLocationIdName('InventLocationIdControl') public void postRun() { SysOperationDialog reportDialog; reportDialog = this.dialog(); custGroupRecIdsControl = dialog.formRun().design().addControl(FormControlType::String, #InventLocationIdName); custGroupRecIdsControl.visible(false); } public void build() { SAFTReportContract_Base_W contract; DialogField dialogField; contract = this.dataContractObject() as SAFTReportContract_Base_W; dialogField = this.addDialogField(methodStr(SAFTReportContract_Base_W, parmInventLocationIdMulti), contract); } public void postBuild() { DialogField dialogField; SAFTReportContract_Base_W contract; ; super (); contract = this.dataContractObject(); dialogField = this.bindInfo().getDialogField(this.dataContractObject(), methodstr(SAFTReportContract_Base_W, parmInventLocationIdMulti)); dialogField.registerOverrideMethod(methodstr(FormStringControl, lookup), methodstr(SAFTReportSZMUI, custGroupIdLookup), this); } protected void custGroupIdLookup(FormStringControl _control) { Query query; QueryBuildDataSource qbds; SysLookupMultiSelectGrid lookup; container selectedFields; query = new Query(); qbds = query.addDataSource(tableNum(InventLocation)); qbds.addSelectionField(fieldNum(InventLocation, InventLocationId)); qbds.addSelectionField(fieldNum(InventLocation, Name)); qbds.addSelectionField(fieldNum(InventLocation, InventSiteId)); selectedFields = [tableNum(InventLocation), fieldNum(InventLocation, InventLocationId)]; lookup = new SysLookupMultiSelectGrid(); lookup.parmCallingControlStr(_control); lookup.parmCallingControl(_control); // lookup.parmCallingControlId(custGroupRecIdsControl); lookup.parmSelectField(selectedFields); lookup.parmQuery(query); lookup.run(); } }
Extends is something related to inheritance concept where you will extend the class and override its method.
ExtensionOf will keep the original code and add your custom code on top or bottom of it.
Also, if you are duplicating the contract class don't extend the standard contract class.
Thanks,
Girish S.
I was looking on the classes, there are many entensions for different region and I found one that includes a UI builder. So does that mean that you actually can add UI builder in a extension?
What is the difference in using extends over ExtensionOf?
[
DataContract,
SysOperationGroup('Period', "@SYS40", '1'),
SysOperationGroup('ExportAll', "@StandardAuditFile_SAFT_W:ExportAll", '2'),
SysOperationGroup('Export', "@SYS26056", '3'),
SysOperationGroup('ContactPerson', "@SYS325541", '4'),
SysOperationContractProcessing(classStr(SAFTReportUIBuilder_Standard_W))
]
internal class SAFTReportContract_Standard_W extends SAFTReportContract_Base_W
If using the standard base contract works means - You still need to do some changes in the duplicated class - May be some class is still pointing to standard contract class instead of your duplicated class. Try double check that one.
Thanks,
Girish S.
The error is in the controller class. Only when I use the duplicated base contract. If I use the standard contract even with the extended fields it works.
I have nothing added yet, the classes are only duplicated just changed the names when calling them.
The init query is a standard method that creates an initial query. The method is called from the controller class.
In which class its throwing error?
Is it in DC class?
What is the purpose of initQuery here?
Is this available in standard or your customization?
Thanks,
Girish S.
Okay so i duplicated the contract, controller now I have a error that the contract is null. If i use the old one its fine.
The error occours here.
private void initContract() { if( !xSysLastValue::getLast(this)) { SAFTReportContract_Base_W_SZM contract = this.getDataContractObject() as SAFTReportContract_Base_W_SZM; contract.initQuery(); } } [ DataContract, SysOperationGroup('Period', "@SYS40", '1'), SysOperationGroup('ExportAll', "@StandardAuditFile_SAFT_W:ExportAll", '2'), SysOperationGroup('Export', "@SYS26056", '3'), SysOperationGroup('ContactPerson', "@SYS325541", '4'), SysOperationGroup('TaxAuthority', "@SYS21937", '5'), SysOperationGroup('SubmittingPurpose', "@StandardAuditFile_SAFT_W:SubmittingPurpose", '6'), SysOperationGroup('Warehouse', "@SYS6437", '7'), SysOperationGroup('ReportingParameters', "@StandardAuditFile_SAFT_W:ReportingParameters", '8'), DataContractAttribute, SysOperationContractProcessingAttribute(classStr(SAFTReportSZMUI)) ]
If there is no UI builder class on the standard report you cannot add that via extension. Its better to duplicate all the standard report objects and use that.
Also if you add new parameters via extension its hard to add range to the DP class through extension. So its better to duplicate all report objects.
Thanks,
Girish S.
No, or at least I didnt find any.
Does the standard report have UI builder class?
Thanks,
Girish S.
I tried but the UI buider is not being hit.
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,817
Most Valuable Professional
nmaenpaa
101,156