filters question

witcher85
Member Posts: 7
Hi!
There is a filtered "Customer" record.
I would like to get those "Sales Invoice Header" lines, where the "Sell-to Customer" field is in the Customer record.
How can I do it?
Thanks for the answer
There is a filtered "Customer" record.
I would like to get those "Sales Invoice Header" lines, where the "Sell-to Customer" field is in the Customer record.
How can I do it?
Thanks for the answer
0
Comments
-
e.g.
"Sales Invoice Header".SETRANGE("Sell-to Customer No.",Customer."No."); "Sales Invoice Header".FINDSET;
"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
It's working good if I want to filter only one customer "no.", but not if i would like to filter more than one customer.
Eg:
filtered customer table: (No.)
- C0001
- C0003
- C0008
In the "Sales Invoice Header" these three customer have altogether 10 invoices. I would like to filter the "Sales Invoice Header" that contains these invoices only.0 -
If the Customer table is already filtered then you could use
"Sales Invoice Header".SETFILTER("Sell-to Customer No.",Customer.GETFILTER("No.")); "Sales Invoice Header".FINDSET;
"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
it's work, but
I have an other question:
what there is in that case, when I filter e.g. the Sales (LCY)? This field not in the "Sales Invoice Header"...
e.g.:
cust.SETFILTER(cust."Sales (LCY)", '>=1000');
"Sales Invoice Header".SETFILTER("Sell-to Customer No.",Customer.GETFILTER("Sales (LCY)")); //<-- not works
"Sales Invoice Header".FINDSET;0 -
Just to clear this out:
Is this the exact code?
You filter on cust:cust.SETFILTER(cust."Sales (LCY)", '>=1000');
But you get the filter from customer:Customer.GETFILTER("Sales (LCY)")
0 -
Sorry, I want to write:
Customer.SETFILTER(Customer."Sales (LCY)", '>=1000');
"Sales Invoice Header".SETFILTER("Sell-to Customer No.",Customer.GETFILTER("Sales (LCY)")); //<-- not works
"Sales Invoice Header".FINDSET;0 -
witcher85 wrote:Sorry, I want to write:
Customer.SETFILTER(Customer."Sales (LCY)", '>=1000');
"Sales Invoice Header".SETFILTER("Sell-to Customer No.",Customer.GETFILTER("Sales (LCY)")); //<-- not works
"Sales Invoice Header".FINDSET;
And do you filter on the Customer Code using a filter from an Amount field?0 -
witcher85 wrote:"Sales Invoice Header".SETFILTER("Sell-to Customer No.",Customer.GETFILTER("Sales (LCY)")); //<-- not works"Money is likewise the greatest chance and the greatest scourge of mankind."0
-
I know that it doesn't work because the different type of the field.
That code was only a bad example.
Have you got any hint how can i solve this problem another way?0 -
It depends on what you want to do. Is it a report? How should it look like?"Money is likewise the greatest chance and the greatest scourge of mankind."0
-
these code in a form button onclick function.
I filtered the "Sales Invoice Header" then I call a codeunit function.
These codeunit function send the invoice details for the customers via email.
I think I can check the amount in the codeunit function. But it not a very nice solution, but if its the only then i have to do that.0 -
I assume that the source table of your form is "Sales Invoice Header" and that you pass it as a record into your function.witcher85 wrote:I think I can check the amount in the codeunit function. But it not a very nice solution, but if its the only then i have to do that."Money is likewise the greatest chance and the greatest scourge of mankind."0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions