Hello,
I have a problem in finding a code seller.
I look for the most recent sale with a vendor code active. And retrieve this code seller.
Here's what I do:
EnteteFacture.INIT;
EnteteFacture.RESET;
EnteteFacture.SETCURRENTKEY("N° donneur d'ordre");
EnteteFacture.ASCENDING(FALSE);
EnteteFacture.SETRANGE("N° donneur d'ordre","N° prospect");
MESSAGE(FORMAT(EnteteFacture.COUNT));
EnteteFacture.FIND('-');
IF EnteteFacture.FIND('-') THEN REPEAT
Vendeur.GET(EnteteFacture."Code vendeur");
MESSAGE(EnteteFacture."Code vendeur");
IF Vendeur.Actif = TRUE THEN BEGIN
"Code vendeur" := EnteteFacture."Code vendeur";
EXIT;
END;
UNTIL NEXT = 0;
My code is good? because I can not get the good result
thank you for the help you can give me
0
Answers
Do you get any messages? Look at my comment in the code
For EnteteFacture."Code vendeur", I have a number and this is the good number
That's why I don't understand why it doesn't work
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I feel that my REPEAT loop does not work and he does not repeat until it is not a good result
You will find attached screenshots of examples, as well as the complete code that is executed in the table.
Anything I add, you will find after //JW
There may be something else that conflicts but I can not find anything.
I have to add a function for what I need I call UpdateCodeVendeurCampagneFidé
I think "UNTIL NEXT = 0;" should be "EnteteFacture.NEXT = 0;".
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
I had not thought about it because I thought the "NEXT" was implicit but thinking a little more, it is logical