Comments & OnLookup

BeliasBelias Member Posts: 2,998
edited 2012-12-04 in NAV Tips & Tricks
i just noticed that even if there are only comments in the onlookup trigger of a field in a table, the table relation used to look up the table (for example) won't be considered when looking up that field. In other words, in order to not use the onlookup trigger, it is not sufficient to comment out your code, you MUST delete it :shock:
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Comments

  • ajhvdbajhvdb Member Posts: 672
    Yep, the problem with this is, in three months time you forget about this and again, you spend 1 hour finding this out again. for example: try a lookup directly in a table view :o
  • garakgarak Member Posts: 3,263
    a BLANK line is enought to say the System: "Use the lookup trigger". So the trigger should be empty if you won't use it
    Do you make it right, it works too!
  • BeliasBelias Member Posts: 2,998
    fortunately, it never happened to me in 2y of developing...i noticed this while messing with pages and the new lookups...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Belias wrote:
    fortunately, it never happened to me in 2y of developing...i noticed this while messing with pages and the new lookups...


    I think this was the first "bug" I reported to PC&C with the new Windows product. After waiting weeks for a reply, the response was "please read the manuals" and yes it does actually state that any code in the trigger will replace the default functionality. So this is a feature, not a bug.

    Since then I read the manuals a lot closer and more literally.
    David Singleton
  • BeliasBelias Member Posts: 2,998
    So this is a feature, not a bug

    this sounds familiar... :wink:
    anyway, i can't understand any good reason to make valid blank and commented lines of code...but i can't see the big picture of "god microsoft" :roll:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • David_SingletonDavid_Singleton Member Posts: 5,479
    The logc was that the program simply looks to see if the trigger is blank, and if blank does its thing. Even a commented line generates something, so that is the trigger to say "Don't perform the default action." Its crazy, but logical in a Danish sort of way. :mrgreen:
    David Singleton
  • DenSterDenSter Member Posts: 8,307
    Having any local variables in there will also screw you up.
  • DenSterDenSter Member Posts: 8,307
    Belias wrote:
    but i can't see the big picture of "god microsoft" :roll:
    I think that is a bit unfair. It has worked like this since well before Microsoft took over.
  • BeliasBelias Member Posts: 2,998
    I was joking...you're right :wink: ..."these" are not problems...it's only a "strange" thing :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • garakgarak Member Posts: 3,263
    I think this was the first "bug" I reported to PC&C with the new Windows product.

    :lol: that was also my first "bug" report. Long long time ago .....
    Do you make it right, it works too!
  • BeliasBelias Member Posts: 2,998
    damn it! the same happens for OnFindRecord Trigger...but the behaviour is more weird here...nav opens the page but does not show any record...i guess that a line of commented code overwrites the standard behavior (as onlookup trigger does), but the "which" parameter is still blank... :cry:
    i just wasted nearly an hour #-o
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Maria-SMaria-S Member Posts: 90
    #-o
    try a lookup directly in a table view :o
    Exactly!

    Just spent about an hour to solve the mystery.
    Thank you for mentioning this!
Sign In or Register to comment.