copy date field from one company to another company

hacihaci Member Posts: 4
Hi All,
Can anyboy help me about,
I would like copythe date(fromdate & ToDate) field in form 101 to another company

here is my code: when I execute its gave me an error that the record is been changed by another person when he was reading.


code :


IF xRec.FIND('-') THEN BEGIN
REPEAT
txtName := xRec.Name;
dtFrom := xRec."Allow Posting From";
dtTo := xRec."Allow Posting To";

IF CHANGECOMPANY('AAAAA') THEN BEGIN
IF xRec.FIND('=') THEN BEGIN
IF xRec.Name = txtName THEN BEGIN
xRec."Allow Posting From" := dtFrom;
xRec."Allow Posting To" := dtTo;
END;
END
END;

CHANGECOMPANY(COMPANYNAME);
UNTIL xRec.NEXT = 0;
END;

Comments

  • kinekine Member Posts: 12,562
    Please, do not use xRec and Rec for this operation. Define your own variable and use that. You will not have such a problem...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.