Hi,
I need to add a Listpart to the Jobs Card Page, wich represents several departments involved in the job. A second Listpart should show the Job Tasks, but only those belonging to the department currently selected in the department Listpart. So when a different Department is selected, different Job Tasks are displayed.
I already have the function in the Card Page that would filter the Job Tasks according to the department selected, but how do I trigger it?
Any suggestions are welcome!
0
Answers
I am not 100% sure I understand what you want to achieve, but from what I understood, I would suggest
in the department Listpart on the trigger AfterGetCurrRrecord, you put your code to populate the second listpart. In my opinion this should work.
You can call the function from a subpage by using
CurrPage.Departmentlistpart.FORM.GetSelectedRec(selectedILE);
where Departmentlistpart is the name in properties for Department listpart.
Another option would be to use a listpart based on a temporary table. Take a look at the page property SourceTable temporary.
I hope this helps.
Although I already implemented a function like you suggested in the first ListPart to get the current record, I can only call this function from the CardPage. And this is the problem. The CardPage has to call this function when the current record in the ListPart changes, but it doesn't know when this happens.
Events would be ideal for this if the CardPage could suscribe to the OnGetCurrentRecord event of the ListPart, but this seems not possible. Or is it?
Although it would be possible to use a timer event on the CardPage to poll the current record of the ListPart periodically, this would be an evil hack and I don't like to use such stuff.