Date in RTC

Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
edited 2011-04-21 in NAV Three Tier
Hi guys!
In a custom page I created an action that launches a Classic report.
But it gives me this error.

Since this error appears before showing the request form I think that the RTC doesn't like function I call in the trigger OnOpenForm().
IF VarBoolean THEN BEGIN
   VarDate := 0D;
   RequestOptionsForm.TextBoxValidityDate.ENABLED := FALSE;
END ELSE
   RequestOptionsForm.TextBoxValidityDate.ENABLED := TRUE;
I'm wondering if it's different the value of 0D in RTC :-k
could anyone give me a suggestion?
Thx in advance!
~Rik~
It works as expected... More or Less...

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Are you sure that you are getting error at vardate := 0D;?
    why because, in the error it is showing different date.. :-k

    BTW, did you try with Format(Date)?
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Are you sure that you are getting error at vardate := 0D;?
    why because, in the error it is showing different date.. :-k

    BTW, did you try with Format(Date)?
    I'm not sure... but It's the only code that could be executed because the error comes before the request form
    ~Rik~
    It works as expected... More or Less...
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Identify the place where exactly is coming and you can use Format(Date)
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Identify the place where exactly is coming and you can use Format(Date)
    ok Mohana I'll use my dear friend Debugger.
    Thx for help!
    ~Rik~
    It works as expected... More or Less...
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    In order to find the error I placed a simple message in the trigger OnInit() of Request form.
    The message isn't showed because error comes before...
    ](*,) the date showed in the error is my working date. I changed it many times but nothing changed...
    ~Rik~
    It works as expected... More or Less...
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    In the begining of the OnOpen form, try by adding Format(Workdate)
  • mihail_kolevmihail_kolev Member Posts: 379
    is the request form enabled for the report?
    -Mihail- [MCTS]
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    In the begining of the OnOpen form, try by adding Format(Workdate)
    but to what I assign the return value?
    ~Rik~
    It works as expected... More or Less...
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    is the request form enabled for the report?
    yes yes. because if I launch report from Classic Client works as expected.
    ~Rik~
    It works as expected... More or Less...
  • mihail_kolevmihail_kolev Member Posts: 379
    then put debug messages in the request PAGE :):):)
    -Mihail- [MCTS]
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    then put debug messages in the request PAGE :):):)
    I don't have a request page...
    ~Rik~
    It works as expected... More or Less...
  • mihail_kolevmihail_kolev Member Posts: 379
    Am I missing something... You use the report in RTC with or without layout? If you have layout, then the request form will never show, you should create request page.

    EDIT Ooops, sorry, i missed that. You launch classic report in rtc...
    -Mihail- [MCTS]
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    You can assign it to a new varialbe or VarDate

    From where you are getting VARBoolean and VarDate?
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Am I missing something... You use the report in RTC with or without layout? If you have layout, then the request form will never show, you should create request page.
    I launch it from RTC but it hasn't RDLC. if I'm not wrong... if report has no Layout designed, also if I launch it from RTC, will be launched 2 tier report, isn't it?
    ~Rik~
    It works as expected... More or Less...
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Am I missing something... You use the report in RTC with or without layout? If you have layout, then the request form will never show, you should create request page.
    I launch it from RTC but it hasn't RDLC. if I'm not wrong... if report has no Layout designed, also if I launch it from RTC, will be launched 2 tier report, isn't it?

    Yes, you are 100% right..
  • mihail_kolevmihail_kolev Member Posts: 379
    Am I missing something... You use the report in RTC with or without layout? If you have layout, then the request form will never show, you should create request page.
    I launch it from RTC but it hasn't RDLC. if I'm not wrong... if report has no Layout designed, also if I launch it from RTC, will be launched 2 tier report, isn't it?
    Yes, excuse me, missed some text (I need some sleep I guess). :oops:
    -Mihail- [MCTS]
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Am I missing something... You use the report in RTC with or without layout? If you have layout, then the request form will never show, you should create request page.
    I launch it from RTC but it hasn't RDLC. if I'm not wrong... if report has no Layout designed, also if I launch it from RTC, will be launched 2 tier report, isn't it?
    Yes, excuse me, missed some text (I need some sleep I guess). :oops:

    no problem Mihail :D
    Thank you Mihail and thank you Mohana for help you're giving me.
    ~Rik~
    It works as expected... More or Less...
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    From where you are getting VARBoolean and VarDate?

    Is something else executed before this code
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    From where you are getting VARBoolean and VarDate?

    Is something else executed before this code
    They're 2 fields of request form.
    edit: no there's nothing before this code.
    ~Rik~
    It works as expected... More or Less...
  • mihail_kolevmihail_kolev Member Posts: 379
    And are you sure you are connecting to the correct database - you say that the report works from classic client, but the error on the screenshot is from classic client instance. So I guess you might connect to the wrong database...
    -Mihail- [MCTS]
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    And are you sure you are connecting to the correct database - you say that the report works from classic client, but the error on the screenshot is from classic client instance. So I guess you might connect to the wrong database...
    Checked... It's the right DB
    ~Rik~
    It works as expected... More or Less...
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    From where you are getting VARBoolean and VarDate?

    Is something else executed before this code
    They're 2 fields of request form.
    edit: no there's nothing before this code.

    Then you should have added your code in OnPre Report trigger

    Otherwise everytime your else part code will be executed..
  • st0328st0328 Member Posts: 97
    In order to find the error I placed a simple message in the trigger OnInit() of Request form.
    The message isn't showed because error comes before...
    ](*,) the date showed in the error is my working date. I changed it many times but nothing changed...


    how u r calling u r report. Either by Code Or Proporty..

    Try to keep a message on Report - OnInitReport()..

    and run the report again.. Once..
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    st0328 wrote:
    In order to find the error I placed a simple message in the trigger OnInit() of Request form.
    The message isn't showed because error comes before...
    ](*,) the date showed in the error is my working date. I changed it many times but nothing changed...


    how u r calling u r report. Either by Code Or Proporty..

    Try to keep a message on Report - OnInitReport()..

    and run the report again.. Once..

    already done! the error comes before
    ~Rik~
    It works as expected... More or Less...
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    From where you are getting VARBoolean and VarDate?

    Is something else executed before this code
    They're 2 fields of request form.
    edit: no there's nothing before this code.

    Then you should have added your code in OnPre Report trigger

    Otherwise everytime your else part code will be executed..

    you're right! I miss an information! before executing this code I put the variable to true and then I execute that code.
    that code is called again on the trigger OnValidate() of that VarBoolean.
    ~Rik~
    It works as expected... More or Less...
  • mihail_kolevmihail_kolev Member Posts: 379
    something about the Windows Regional settings - the date format
    -Mihail- [MCTS]
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    If you can, export the report in text format and paste here
  • BeliasBelias Member Posts: 2,998
    Hi guys,
    we (me, my colleague Troubles in Paradise and another colleague of mine) have solved the problem:
    The installed CLIENT version was 32275, but the SERVER version was 32012.
    If i remember well, some hotfix between these versions have fixed something about the date/time zones or something similar, and i guess that this could have generated the problem because of the different date/time management.
    Thanks everyone for your effort, it is really appreciated :thumbsup:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    Thx again for help!
    :D I can put "Solved" on this topic
    ~Rik~
    It works as expected... More or Less...
Sign In or Register to comment.