Two ListParts on one Card Page with dependencies

AKAK Member Posts: 226
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!

Best Answer

Answers

  • vremeni4vremeni4 Member Posts: 323
    Hi,

    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.
  • AKAK Member Posts: 226
    Thanks, but I think this will not work. I've no access to Navision at the moment, so I can't test your idea, but IIRC I don't have any access to the second ListPart from the first one. Only from the card form.
    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.

Sign In or Register to comment.