Dear friends,
I explain in a simple way, I have 3 tables:
-Edition (Code, Designation,...) // Primary key is Code
-Page (Code, Designation,...) // Primary key is Code
-Edition/Page Assignment (Edition Code, Page Code,...) // Primary key is Edition Code, Page Code
I set filter on "Edition/Page Assignment" in order to only have pages for one Edition.
-> EditionRec is the Record resulting of EditionRec.SETFILTER(Edition Code,'my_edition_code');
I want to open the form "List of Pages" based on Table "Page" but filtering the records in order to only get the list of pages contained in EditionRec (in a specific edition).
=> problem is : in FORM.RUNMODAL(formID,RECORD) , RECORD is based on the source table, in my case EditionRec is not based on the form source table.
I don't know if it is possible to get only some records based on table "Page" when you have a list of page code for example....
PS:For one edition, it is possible to have sereval times the same page with different Headers and sub-headers
Thanks!
0
Comments
Here are some:
1.
You can create some kind of functionality that concatenates the filter you need. The code can be like this: This way you have your filter, which you can use like this to open your form:
2.
If it is not necessary to edit in the form you want to open, just create some LookUp-Flowfields in the Edition/Page-table that looks up the descriptions you want from the Edition table and the Page table. Then, you can base your list-form on the Edition/Page-table, and just use the filter on EditionRec (GETFILTER(Code)).
I hope this is clear, and this can help you ...
Regards.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Thanks a lot Waldo
Record.COPYFILTER(FromField, ToRecord.ToField)
This will copy the filter from the first specified Table.Field to the second specified Table.Field.
A lot simpler.
The filter is on "Edition Code" of the Edition/Page Assignment table, and he wants to filter the Page table on the code field.
But probably you just interpreted my code, which indeed you can replace by COPYFILTER. Morgan needed not exactly that code, but had to program something likewise ...
I think I should have written the following to avoid the mix-up:
where EditionPageRec is filtered on "Edition Code".
Regards.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
But your solution runs well!
Sorry for the confusion.