Filtering report with Setfilter/Navision Expert Needed
zulq
Member Posts: 204
I am developing a report which shows employees who've not paid their contributions. All employees are in the employee table and all contributions are in a contributions table. Below is what I've done so far:
Contributions
Employee (indented).
Now my problem is when I try to filter employees who are not in the contributions table the filter doesn't work.
Here's my filter and I tried placing it on both PreDataItem and AfterGetRecord
Employee.SETFILTER("No.",'<>Contributions."Employee No.");
I also tried this but gets an error:
SETFILTER("No.",'<>',Contributions."Employee No.");
I've tried several times altering the filter and even using setrange to no avail.
Any Ideas please!
Also our company is looking for a navision expert who will be working for us as consultant/developer. Interested individuals can send me a private message. ](*,)
Contributions
Employee (indented).
Now my problem is when I try to filter employees who are not in the contributions table the filter doesn't work.
Here's my filter and I tried placing it on both PreDataItem and AfterGetRecord
Employee.SETFILTER("No.",'<>Contributions."Employee No.");
I also tried this but gets an error:
SETFILTER("No.",'<>',Contributions."Employee No.");
I've tried several times altering the filter and even using setrange to no avail.
Any Ideas please!
Also our company is looking for a navision expert who will be working for us as consultant/developer. Interested individuals can send me a private message. ](*,)
Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?
0
Comments
-
Hi Zulq,
Better to reverse the dataitems
Employee
->Contributions
on contribution properties DataItemLinkReference Employee No.=FIELD(No.)
Hope this helps
0 -
If what you want is the List of Employees, then you could do the following:
Employee (DataItem)
ContribRec (Variable SubType = Record, Value = Contributions Table)
OnAfterGetRecord trigger of Employee Dataitem
ContribRec.SETRANGE("Employee No.",Employee."No.");
.... Other Filters
....
....
IF NOT ContribRec.Find('-') then
CurrReport.SKIP;
Or you Could Create a FlowField (ContribValue say) that contains the Value Contributed by each Employee.
Set Filter on the Employee DataItem for the FlowFilters related to the FlowField (ContribValue)
OnAfterGetRecord trigger of Employee Dataitem
Employee.CALCFIELDS(ContribValue);
IF (Employee.ContribValue = 0) then
CurrReport.SKIP;
Sunday, Godwin G0 -
Thanks Albertvh and sgg but your methods ain't working.
Let me explain more- The report I want should list all employees except the ones in the contributions table. The unique key linking the employee and contributions tables are "No." and "Employee No." respectively.
For example if it was mysql i would just say:
Select * from employee where employee.No. != Contributions.'Employe No.'
NB: I've tried sgg's method only as Albertvh's response obviously will not work in this scenario.Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?0 -
Hi
Use sgg method but change the code
IF NOT ContribRec.Find('-') then
CurrReport.SKIP;
to
IF ContribRec.Find('-') then
CurrReport.SKIP;0 -
Thanks a lot....Albertvh and sgg.....
My problem is solved. \:D/ \:D/ \:D/Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?0 -
u can do this with only one Dataitem named As employee put the field As Contribution code and relate it with Contribution table by using table relation ok.then on the properties of Employee Dataitem Select Dataitemtableview and in key firstly make the key named "Contribution code" and in table filter select the contribution code in field tab selct filter and in the value tab write this symbol (' ') then apply it.oku'll find the right answer.
Now tell me that u told that u require navision expert please teel me ur personal mail idand mail it on my personal id i.e.,vikram7_dabas@yahoo.co.in,vikram.dabas@gmail.com and my mobile no. is 09355712543.i am from india.Vikram Dabas
Navision Technical Consultant0 -
tell me that how i can join ur company.i am Navision tehnical consultant in indiazulq wrote:I am developing a report which shows employees who've not paid their contributions. All employees are in the employee table and all contributions are in a contributions table. Below is what I've done so far:
Contributions
Employee (indented).
Now my problem is when I try to filter employees who are not in the contributions table the filter doesn't work.
Here's my filter and I tried placing it on both PreDataItem and AfterGetRecord
Employee.SETFILTER("No.",'<>Contributions."Employee No.");
I also tried this but gets an error:
SETFILTER("No.",'<>',Contributions."Employee No.");
I've tried several times altering the filter and even using setrange to no avail.
Any Ideas please!
Also our company is looking for a navision expert who will be working for us as consultant/developer. Interested individuals can send me a private message. ](*,)Vikram Dabas
Navision Technical Consultant0 -
Change structure of your report in a way as Albertvh wrote.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions