Processing Only Report to Assign Customer to a Salesperson

emulsifiedemulsified 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.
Half-empy or half-full how do you view your database?

Thanks.

Answers

Sign In or Register to comment.