Get userid

paulcampbellpaulcampbell Member Posts: 7
hi,
first post here, only starting to learn navision over the past few weeks.

Im in the process of creating a simple form that is accessing one table, filtering the data that it is displaying and allowing for modifications to the fields (which i added to the table structure).

Im looking to get the username of anyone who makes a modification to any entry on the table and record the last user who made a modification to that line item. I have seen it before in other tables/forms, but am unable to see how to get it working.

Im very certain that this is a simple operation to perform, however im at a loss to see how, typical newbie stuff :)

I had a look at the Application Designers Guide but couldnt see anything to deal with this.

What i have done so far is created this entry within the table

Updated By Code 10 ,
properties behind field --> TableRelation "User Setup"."User ID"

then connected this to the Form i want this to occur in, this from what i can see is how it has been setup in other forms that are working, this gives me a link to select what my userid is, im looking for it to autopopulate based on the currently logged in user.

I had a look around the forums but couldnt see anything along the same lines, Can anyone help me out ?


P.

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Hi, welcome to this forum!

    Have you tried to add this to the OnInsert and OnModify triggers of the table? These are activated when a record is created and changed.

    You can add code like
    "Created By" :=  USERID;
    

    Good luck.
  • paulcampbellpaulcampbell Member Posts: 7
    thanks for that, i knew it was gonna be something simple like that but didnt know the system variable, is there a list of the kind of info that can be pulled from the system like that, are they all defined in the symbol menu ?


    I tried to access the CAL code for the table but am unable to ( greyed out ), I can access the cal code within report designer but not within table designer at, i have rights within my license for both. I seem to remember being able to before.

    Using Nav 3.01A
  • kinekine Member Posts: 12,562
    1) Yes, they are all in the symbol menu, more info for them is in the on-line help
    2) If the C/AL code is inaccessible, you are using license file with just report designer, table designer and form designer. You need application builder or solution developer granule to be able to access C/AL code on tables, forms and codeunits.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    There are also manuals on the product CD that explain loads about how the C/AL code works.
  • paulcampbellpaulcampbell Member Posts: 7
    thanks for the help guys
Sign In or Register to comment.