Hi All,
I need to update the Salesperson code in the Contact table, I have used the below code :
Contact.RESET;
Contact.SETRANGE("Salesperson Code",'3803');
Contact.SETCURRENTKEY("Salesperson Code");
IF Contact.FINDSET(TRUE,TRUE) THEN BEGIN
REPEAT
Contact.VALIDATE("Salesperson Code",'5189');
Contact.MODIFY;
UNTIL Contact.NEXT = 0;
END;
There are 4 records within the filter, which i need to modify. But my concern is it only updates only the first record.
And When I Removed the "Contact.SETCURRENTKEY("Salesperson Code");" Line of code, then it updates all the records.
I did't understand the logic behind that.
Can anyone help?
Thanks in advance.
Comments
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
But in this case, it is even easier:
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Can you guys please elaborate this term a bit more "SQL Server goes astray"?
Hope this makes sense.
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community