Filtering records by date
I am building a monthly commission report. I have created a relationship on the historical data records sorted by date. The commission is to be calculated on the date. I have also created a layout that displays the records related with the commission.
The view of the table is called RequestArrivalMonth and it contains the relevant date field.
The layout is called Commission of the Month. I have also developed a script that is triggered once the layout is loaded. The script is also called CommissionOfTheMonth. In the attached file you can see the contents of the script.
Basically the idea is that the user selects a beginning-of-month date in the dialog. This date is assigned to $tmpVarCurrentDate. I need now to define an end-of-month date in the dialog in order to limit the records to be used for calculating the commission. How do I do it ?
The one option that occurs to me is that I include in the relationship RequestArrivalMonth the start and end dates relevant for the commission ... but then this needs to happen only after the user has selected the month in the layout. Please advise.