Hello,
I search the last active seller for a specific customer.
I wish to exclude from the seller's result that the code "33", "13", "0", "1", starting with "I".
How should I do to move to the next record if the code is part of the vendor codes out?
Here is my code :
EnteteFacture.RESET;
EnteteFacture.SETCURRENTKEY("N° donneur d'ordre");
EnteteFacture.ASCENDING(FALSE);
EnteteFacture.SETRANGE("N° donneur d'ordre","N° prospect");
IF EnteteFacture.FIND('-') THEN REPEAT
Vendeur.GET(EnteteFacture."Code vendeur");
IF Vendeur.Actif = TRUE THEN BEGIN
IF "Code vendeur" = 33 OR "Code vendeur" = 13 OR "Code vendeur" = 0 OR "Code vendeur" = 1 "Code vendeur" = I* THEN BEGIN
//I do not know what to put in this place to jump to the next record
END;
"Code vendeur" := EnteteFacture."Code vendeur";
EXIT;
END;
UNTIL EnteteFacture.NEXT = 0;
Thank you for the help you can give me
0
Answers
In fact, I would go to the next record if I come across a seller that has a code equal to 33, 13, 0, 1 or I *.
How do I do that?
In my opinion, the code should be something as below:
EnteteFacture.RESET;
EnteteFacture.SETCURRENTKEY("N° donneur d'ordre");
EnteteFacture.ASCENDING(FALSE);
EnteteFacture.SETRANGE("N° donneur d'ordre","N° prospect");
IF EnteteFacture.FIND('-') THEN REPEAT
IF NOT (("Code vendeur" IN = 'I')) THEN BEGIN
Vendeur.GET(EnteteFacture."Code vendeur");
......
END;
UNTIL EnteteFacture.NEXT = 0;
I always record with these codes sellers.
Nevertheless, I think this is the right path.
Should maybe I put an else because if I get one of these codes sellers, I have to go to the next invoice.
How can I do that?
thank you
We do loyalty campaigns.
Through my code, I get information about our prospects (name, address, code vendor area code, etc ...)
In these loyalty campaigns, I must search for each prospect the last sale of an active seller and get the code seller.
If unfortunately, the last active seller for a code 33, 13, 0, 1 or I *, I have to go to the next active seller.
If unfortunately, I have no active seller, I owe nothing to the code seller.
This is the part that is written in red I have a problem.
Someone would have a solution to offer me aside from what has already been
Both mentioned solutions should work in certain situations. If they don't you probably miss something. Why don't they work? How do your table relations and fields look like?
To me this looks like you still have some translating to do. You have to go deeper into the detail in what steps are taken. Do you have a senior that you can ask for help? This is typically something that you would do working with someone standing at a white board or with pen and paper.
You will have to be more specific than "it doesn't work", that does not say anything about what is really wrong.
RIS Plus, LLC
In addition, it is not that not everything works but my test I can still have codes Sellers 33 and I *
I realized also that my test IF NOT (("Salesperson Code" IN ) OR ("Salesperson Code" [1] = 'I') ) THEN BEGIN is useless because with or without I get the same result with no filter.
There is the STEFILTER happens to limit my results
If I take the example of the vendor code 33, I get 765 prospects without filter and with SetFilter only 7 but it is still too 7
You also need to be able to look at the same problem from a different angle. Instead of thinking "jump to the next record if something is TRUE", think about "only do something if the same thing is FALSE" and let the loop do its work.
RIS Plus, LLC
Late reply but.....
Change your code to
Hope you still have the problem