Problem with table relation

BlachBlach Member Posts: 6
Hi all

Been a reader of this forum for a long time, and think all of you do an excellent job.

Reason why I've only registered now is that I've got a very strange problem, and I haven't been able to google/search my way to an answer.

Problem is I've got some code that work on a 5.01 client (running ver. 2.60 objects), but the exact same code doesn't work in a 4.03 client (running ver. 2.60 objects aswell).

What I'm doing is, that I insert a rec into a table A, then I insert another rec into another table B.

Table A consists of a number of fields, but the relevant ones are:

ID (Primary Key)
Username

Table B consists of a number of fields but the relevant one is:

UserID (TableRelation to Table A)

When I try to insert the new rec into table B, which have the UserID of the newly created rec (Table A), I get the error:

"Table A ID: <new ID> does not exists"

I have tried doing a commit after the insert into Table A, which didn't resolve the problem. Hope someone out there got an answer to this strange problem.
        Webbruger.INIT;
        Webbruger.VALIDATE(Brugernavn,bNavn);
        Webbruger.INSERT(TRUE);

        KundeWebMap.INIT;
        KundeWebMap.VALIDATE(KædewebbrugerID,Webbruger.ID);
        KundeWebMap.VALIDATE("Kundenr.",Rec.Nummer);
        KundeWebMap.INSERT(TRUE);

Answers

  • kinekine Member Posts: 12,562
    Have you tried latest NAV 4.00SP3 hotfix? Some builds have problems that they do not see some record etc...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • BlachBlach Member Posts: 6
    No hot-fixes added to their version. Guess that's going to be the next thing, will just upgrade to 5.01 tho, since I know it'll work in that.

    Thanks for the answer Kine :)
Sign In or Register to comment.