Codeunit 448: why recordref instead of record variable for session table

Hi,

I'm wondering about the use of recordref/fieldref to access the session table in function InsertJobQueueSession of codeunit 448 (NAV 2009). It seems unnecessary complicated in contrast to declaring a record variable for the session table, filtering for one field and using the value of another field. Is there some reason I'm missing?

Thanks!

Best Answer

Answers

  • AKAK Member Posts: 226
    Never thought of that, thanks!
  • KishormKishorm Member Posts: 921
    I suppose the reason is that the Session table has different ID in Native Client vs SQL Client

    Slawek

    No, the session table is 2000000009 for both Native and SQL backends. You can test this by executing the following...
    MESSAGE('%1',DATABASE::Session);
    
    ...in both types of databases.
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Build a fob on one of platforms, a codeunit for example, which accesses session table, say Server Name, and then export it, put into a another platform and run.
    Session.SETRANGE("My Session", TRUE);
    Session.FINDFIRST;
    MESSAGE('%1',  Session."Host Name");
    
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.