Options

Page's controls problem

Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
edited 2011-04-05 in NAV Three Tier
Hi Guys! I need your help for a problem with a page.
I've a page with this structure:
ContentArea
  Repeater
    field - RespCenterCode
    field - RespName

in the OnOpenPage I put this code:
RecordUserSetup.RESET;

RecordUserSetup.GET(USERID);

IF RecordUserSetup."Sales Resp. Ctr. Filter" = '' THEN BEGIN
  RecordSession.SETRANGE("My Session",TRUE);
  IF RecordSession.FINDFIRST THEN BEGIN
    RecordUserSession.RESET;
    RecordUserSession.SETRANGE("Connection No.",RecordSession."Connection ID");
    IF RecordUserSession.FINDFIRST THEN BEGIN
      RespCenterCode := RecordUserSession."Responsibility Center";
      RespCenterCode.RESET;
      RespCenterCode.GET(RespCenterCode);
      RespName := RespCenterCode.Name;
      MESSAGE(FORMAT(RespCenterCode));
      MESSAGE(FORMAT(RespName));
    END;
  END;
END ELSE BEGIN
  RespCenterCode.RESET;
  IF RespCenterCode.GET(RecordUserSetup."Sales Resp. Ctr. Filter") THEN BEGIN
    RespCenterCode := RespCenterCode.Code;
    RespName := RespCenterCode.Name;
    MESSAGE(FORMAT(RespCenterCode));
    MESSAGE(FORMAT(RespName));
  END;
END;

the problem is on the else part of the test... in fact as you can see from the code I put 2 messages at the end of the else and they show me exactly what I expect (so I think code is right) but the page doesn't print anything...
anyone could give me any suggestions?
Thx in advance!
~Rik~
It works as expected... More or Less...

Answers

  • Options
    deV.chdeV.ch Member Posts: 543
    what's the sourcetable of the page? I think the repeater only will show you the values if there are records in the sourcetable.
  • Options
    BeliasBelias Member Posts: 2,998
    the number of records in a repeater depends on the filtered records of the source table. If there's no sourcetable, you have no records, no matter what you want to print.
    If you have a sourcetable, be sure that it contains at least one record.
    If you don't have it you can use "integer" as sourcetable, and filter it only for number = 1.
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Thx for reply!
    The Source Table is "User and Session"
    ~Rik~
    It works as expected... More or Less...
  • Options
    raveendran.sraveendran.s Member Posts: 119
    Thx for reply!
    The Source Table is "User and Session"

    Have you checked is there any records in this table?
    --
    Regards,
    Raveendran.BS
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Yes there's one record that shows me the user and his Responsibility Center
    ~Rik~
    It works as expected... More or Less...
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Hi Guys! Solved!

    I must say sorry to you because when I said that there was a record in the sourcetable I was wrong :oops:!
    In fact in codeunit 1 there was a personalization that deleted record in my sourcetable.
    Since I can't delete this personalization Belias suggest me 2 solutions:
    - use an integer sourcetable as you can read above
    - use a temporary sourcetable, insert the value that I want to see in this temporary table and then show the 2 fields just inserted

    Thx all for help!
    ~Rik~
    It works as expected... More or Less...
Sign In or Register to comment.