Handling business logic on triggering events of dialog methods of SSRS report in D365FO
Hi,
Please refer to my earlier post to view the report SSRSPrecisionDesign related classes, tables and menu Item.
Custom Tables: SampleTable and SampleTrans
In this post, we will how can we substitute custom method in place of dialog field event methods like modified, lookup and so on. For demo purpose, let us try to default the dialog field end date value with the dialog field start date value whenever start date value is modified.
Note: Please generate the labels accordingly, for demo purpose static text is left as-is.
Step 1: Created a UI builder class SSRSReportUIBuilder(namely) for the contract class SSRSReportContract
class SSRSReportUIBuillder extends SrsReportDataContractUIBuilder.[ DataContractAttribute, SysOperationContractProcessingAttribute(classStr(SSRSReportUIBuillder), SysOperationDataContractProcessingMode::CreateUIBuilderForRootContractOnly), SysOperationGroupAttribute('Criteria',"Criteria",'1')]class SSRSReportContract implements SysOperationValidatable, SysOperationInitializableStep 3: Implemented the build method to get the dialog field values of StartDate and EndDate.
/// <summary> /// The <c>SSRSReportUIBuillder</c> class builds the UI for the <c>SSRSPrecisionDesignReport</c> SSRS report parameters /// </summary> public void build() { SSRSReportContract reportContract; super(); reportContract = this.dataContractObject() as SSRSReportContract; startDateField = this.bindInfo().getDialogField(reportContract, methodStr(SSRSReportContract, parmStartDate)); endDateField = this.bindInfo().getDialogField(reportContract, methodStr(SSRSReportContract, parmEndDate)); }
/// <summary> /// Overridden method of StartDate dialog field's modified method. /// </summary> /// <returns> /// boolean variable value as true if its modified /// </returns> public boolean onStartDateModified(FormDateControl _dateControl) { endDateField.value(startDateField.value()); return true; }
Step 5: Implemented the method postBuild to substitute the method onStartDateModified in place of modified method of dialog field StartDate.
/// <summary> /// Post build method /// </summary> public void postBuild() { super();startDateField.registerOverrideMethod(methodStr(FormDateControl, modified), methodStr(SSRSReportUIBuillder, onStartDateModified), this); }Chaitanya Golla

Like
Report
*This post is locked for comments