How is possible to count record at second level?
If I have this structure in a report (12174-"Issued Cust Bills Report"):
- DataItem1 ("Issued Customer Bill Header")
- DataItem2 ("Issued Customer Bill Line")
How can I count DataItem2 items linked to DataItem1 before processing them ??
I thinked to use COUNT on DataItem2 in the trigger "OnAfterGetRecord" of DataItem1: firts I set the filter on dataitem2 using the link field between the dataitems ("Customer Bill No." = "No.") and then call FIND, but it gives an error (probably becouse I specify only 1 key of the 2 of DataItem2: I use only "Customer Bill No." but no "Line No."). But I can't know the second key ("Line No.") at prior.
Any idea??
Kiki
0
Comments
doing it your way should be fine as well ... appying the SETRANGE yourself. You don't need to call "FIND" though ... a count after the SETRANGE should be enough.
I tested it in a codeunit:
gave me a message:
1
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog