Field Menu on a trigger

flintflint Member Posts: 44
Hi,

I add a function in a codeunit based on a table(TableNo setted).

No i want to get the fields of this table on my new procedure.

how can i get the fields in the field menu dialogue ?


Thanks

Comments

  • krikikriki Member, Moderator Posts: 9,115
    Check the virtual table "Field" for the fields in a table.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • flintflint Member Posts: 44
    When i'm on the trigger "OnRun" all fields appears (by clicking on hte FIELD MENU button).

    But when on my new triggers nothing appears.

    that's sound strange.

    Thanks
  • kinekine Member Posts: 12,562
    The parameter is passed as local variable (OnRun parameter with name Rec ;-)). If you need the values in other functions, you need to pass it to them or save it into global variable.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • flintflint Member Posts: 44
    This thing drive me crazy !!

    i created a trigger :

    myOnRun(Var Rec : "Table_XXX")

    copy/past all codes from the OnRun triggers.made some change.

    But when i tried to compile the codeunit an error occurs : it does not recognize the fields of my table.

    i noticed that this field are available on the OnRun trigger but not on myOnRun triggers ?

    is there somthing that i'm missing here ??

    thanks for your help
  • kinekine Member Posts: 12,562
    DO not use the Rec name in your procedure or add WITH Rec do begin... in start of your procedure. The Rec in OnRun is handled in this way but implicitly, in custom procedure it is not working in this way...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • flintflint Member Posts: 44
    Thinks.
    it's the only way to do it.
Sign In or Register to comment.