RTC gives an error when trying to assign a value by validate

willywilly Member Posts: 67
edited 2011-10-20 in NAV Three Tier
Hi! I am generating some new job planning lines in nav 2009r2.

When I try to validate the data in the "User Id" field in table 1003 "Job Planning Line" using Validate("User Id",USERID) it gives an error in RTC that the user do not exist.
From the classic client it works without errors.
It is no big deal because I cant assing the value without validating it, but I was just currious why it throws an error?

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Print the USERID field and check the value..

    If I Remember Correctly RTC prints domain\userid
  • willywilly Member Posts: 67
    Print the USERID field and check the value..

    If I Remember Correctly RTC prints domain\userid

    Hi!

    Printing the value gives med only the user name, don't domain + user

    It seems like it tries to look into table 2000000002 User.
    The strange thing is that if I change my code from:

    //old code line
    NewJobPlanLine.VALIDATE("User ID", USERID);

    to:
    //new code line
    IF UserSetupRec.GET(USERID) THEN //UserSetupRec is table 91 User Setup
    NewJobPlanLine.VALIDATE("User ID", UserSetupRec."User ID");

    it works without any problems
  • David_SingletonDavid_Singleton Member Posts: 5,479
    willy wrote:
    The strange thing is that if I change my code from:

    //old code line
    NewJobPlanLine.VALIDATE("User ID", USERID);

    to:
    //new code line
    IF UserSetupRec.GET(USERID) THEN //UserSetupRec is table 91 User Setup
    NewJobPlanLine.VALIDATE("User ID", UserSetupRec."User ID");

    it works without any problems

    Well the good thing then is that you have shared the solution, so if someone else gets the same issue they know how to solve it.

    =D> =D> =D> =D>
    David Singleton
Sign In or Register to comment.