Journal Batch lookup doesn't work in RTC

rocatisrocatis Member Posts: 163
edited 2012-03-26 in NAV Three Tier
Scenario: a simple table with two fields, "Journal Template Name" and "Journal Batch Name". The latter has a table relation depending on the first.

This works like a charm in the Classic Client - just as you would expect.

In RTC, however, the filter is not set correctly when looking up "Journal Batch Name". I have only found one way to work around this bug: using code to do the lookup. This annoys me no end!

Behold:
OBJECT Table 99999 Test
{
  OBJECT-PROPERTIES
  PROPERTIES
  {
    OnInsert=BEGIN
               RESET;
               IF NOT GET THEN BEGIN
                 INIT;
                 INSERT;
               END;
             END;

  }
  FIELDS
  {
    { 1   ;   ;Primary Key         ;Code10        ;CaptionML=[DAN=Prim‘rn›gle;
                                                              ENU=Primary Key] }
    { 2   ;   ;Template Name       ;Code10        ;TableRelation="Gen. Journal Template" }
    { 3   ;   ;Batch Name          ;Code10        ;TableRelation="Gen. Journal Batch".Name WHERE (Journal Template Name=FIELD(Template Name)) }
  }
  KEYS
  {
    {    ;Primary Key                             ;Clustered=Yes }
  }
  CODE
  {

    BEGIN
    END.
  }
}

OBJECT Form 99999 Test
{
  PROPERTIES
  {
    Width=7040;
    Height=1870;
    SourceTable=Table99999;
    OnOpenForm=BEGIN
                 RESET;
                 IF NOT GET THEN BEGIN
                   INIT;
                   INSERT;
                 END;
               END;

  }
  CONTROLS
  {
    { 1   ;Frame        ;220  ;220  ;6600 ;1430 ;HorzGlue=Both;
                                                 VertGlue=Both;
                                                 ShowCaption=No }
    { 4   ;TextBox      ;3850 ;440  ;2750 ;440  ;ParentControl=1;
                                                 InFrame=Yes;
                                                 SourceExpr="Template Name" }
    { 5   ;Label        ;440  ;440  ;3300 ;440  ;ParentControl=4 }
    { 6   ;TextBox      ;3850 ;990  ;2750 ;440  ;ParentControl=1;
                                                 InFrame=Yes;
                                                 SourceExpr="Batch Name" }
    { 7   ;Label        ;440  ;990  ;3300 ;440  ;ParentControl=6 }
  }
  CODE
  {

    BEGIN
    END.
  }
}

OBJECT Page 99999 Test
{
  PROPERTIES
  {
    SourceTable=Table99999;
    PageType=Card;
    OnOpenPage=BEGIN
                 RESET;
                 IF NOT GET THEN BEGIN
                   INIT;
                   INSERT;
                 END;
               END;

  }
  CONTROLS
  {
    { 1000000000;0;Container;
                ContainerType=ContentArea }

    { 1000000001;1;Group  ;
                Name=General;
                GroupType=Group }

    { 1000000003;2;Field  ;
                SourceExpr="Template Name" }

    { 1000000004;2;Field  ;
                SourceExpr="Batch Name";
                TableRelation="Gen. Journal Batch" }

  }
  CODE
  {

    BEGIN
    END.
  }
}
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup

Comments

  • TheDoubleHTheDoubleH Member Posts: 67
    I noticed that, on the page, you have a table relation? Did you add that? Did you try and remove it.
    Kind Regards

    Henrik Helgesen,
    President | Helgesen Consulting
    about.me | LinkedIN
  • rocatisrocatis Member Posts: 163
    I noticed that, on the page, you have a table relation? Did you add that? Did you try and remove it.

    It makes no difference whatsoever, neither on the form nor on the page.
    Brian Rocatis
    Senior NAV Developer
    Elbek & Vejrup
Sign In or Register to comment.