RTC or Classic Client in Code C/AL

AnonymousAnonymous Guest Posts: 137
edited 2009-12-23 in NAV Three Tier
Hello,

In the code C/AL, how to dertermine the client to used (RTC or Classic Client)?

I have a codeunit used in common in RTC and in Classic Client. This Codeunit must run a Page or Form according to the different cases :
- FORM.RUNMODAL(FORM::myForm,rec);
- PAGE.RUNMODAL(PAGE::myForm,rec);

Thanks for your help,

Benoît

Comments

  • Alex_ChowAlex_Chow Member Posts: 5,063
    BDurand wrote:
    Hello,

    In the code C/AL, how to dertermine the client to used (RTC or Classic Client)?

    I have a codeunit used in common in RTC and in Classic Client. This Codeunit must run a Page or Form according to the different cases :
    - FORM.RUNMODAL(FORM::myForm,rec);
    - PAGE.RUNMODAL(PAGE::myForm,rec);

    Thanks for your help,

    Benoît

    Check out the function ISSERVICETIER.
  • rdebathrdebath Member Posts: 383
    BDurand wrote:
    - FORM.RUNMODAL(FORM::myForm,rec);
    - PAGE.RUNMODAL(PAGE::myForm,rec);
    Point of order. If the Form and Page have the same number you don't have to work out which you need to call, just call the form. If the code is running on the RTC the runtime will assume you meant to call the page and do that instead.

    Also if you need to find if you're on the RTC without using ISSERVICETIER (eg the code needs to be compiled on V4) you can check the contents of the field table: Table 2000000071, Field 3, first appear in V6.00. For the RTC you need SQL so the Session table doesn't have column 15 (or check for ROWLEVELLOCKING). If you're on the RTC the Server table isn't there.

    It's a bit more complex, but it does let you detect all the major versions as well as many of the SPs. 8)
  • iceborgiceborg Member Posts: 67
    Just remember that requests also can come via Web Service Tier, in that case ISSERVICETIER = TRUE and GUIALLOWED = FALSE :P
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    http://dynamicsuser.net/blogs/waldo/arc ... -am-i.aspx

    Page and Formnumbers should be the same.

    If you run form.run on the RTC it will run the page with that number. If you start having forms and pages with different numbers the end is lost...
Sign In or Register to comment.