Processing Only Report to Assign Customer to a Salesperson

emulsified
Member Posts: 139
I have a processing only report right now that I want to run.
It should assign any customers with "VIDEO DILEMA" in the Customer.Name field to Customer."Salesperson Code" := 'ANN'
For example I want to apply a filter to Customer.Name like VIDEO DILEMA* because some of the accounts have different store numbers after their names.
Then I want to do a Customer."Salesperson Code" := 'ANN'
Then I do a Customer.MODIFY to save the changes and move on.
My question is how do I get just the group of Customers with their Name like VIDEO DILEMA* ?
Here is my code from my processing only report from Customer - OnAfterGetRecord() section:
REPEAT
IF Customer.Name = 'VIDEO DILEMA*' THEN BEGIN
Customer."Salesperson Code" := 'ANN';
Customer.MODIFY;
END;
UNTIL Customer.NEXT = 0;
I'm pretty sure I need to do something like this:
SETFILTER() or something
REPEAT
Customer."Salesperson Code" := 'ANN';
Customer.MODIFY;
UNTIL Customer.NEXT = 0;
I think I'm on the right track here can someone help me out? It's been a while since I wrote one of these. What should SETFILTER look like, where should it be placed? OnPreDataItem(), OnAfterGetRecord(), OnPostDataItem, or somewhere else?
I know it's pretty simple but my mind is clouded at the moment. Thanks.
It should assign any customers with "VIDEO DILEMA" in the Customer.Name field to Customer."Salesperson Code" := 'ANN'
For example I want to apply a filter to Customer.Name like VIDEO DILEMA* because some of the accounts have different store numbers after their names.
Then I want to do a Customer."Salesperson Code" := 'ANN'
Then I do a Customer.MODIFY to save the changes and move on.
My question is how do I get just the group of Customers with their Name like VIDEO DILEMA* ?
Here is my code from my processing only report from Customer - OnAfterGetRecord() section:
REPEAT
IF Customer.Name = 'VIDEO DILEMA*' THEN BEGIN
Customer."Salesperson Code" := 'ANN';
Customer.MODIFY;
END;
UNTIL Customer.NEXT = 0;
I'm pretty sure I need to do something like this:
SETFILTER() or something
REPEAT
Customer."Salesperson Code" := 'ANN';
Customer.MODIFY;
UNTIL Customer.NEXT = 0;
I think I'm on the right track here can someone help me out? It's been a while since I wrote one of these. What should SETFILTER look like, where should it be placed? OnPreDataItem(), OnAfterGetRecord(), OnPostDataItem, or somewhere else?
I know it's pretty simple but my mind is clouded at the moment. Thanks.
Half-empy or half-full how do you view your database?
Thanks.
Thanks.
0
Answers
-
If the dataitem is customer then all you need
OnAfterGetRecord()
"Salesperson Code" := 'ANN';
MODIFY;
Then run the report you will see the Reqeust Filter Fields
Add Name :VIDEO DILEMA*
Or you can run the customer table from Object Designer
Filter On Name VIDEO DILEMA*
Goto the salesperson column type in ANN & F8 all the way down0 -
Thanks Harry.Half-empy or half-full how do you view your database?
Thanks.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