Change WorkDate in Customized Form through C/AL code in RTC

sdasguptasdasgupta Member Posts: 20
edited 2010-11-04 in NAV Three Tier
Hi there,
Is it possible to chage the workdate as per user input in customized page via C/AL Code in RTC ?
I have a customized form (in classic client) which changes the workdate as per user input. Actually trying to replicate the Work Date form (Tools menu -> Work Date).
Have added this form in Codeunit 1,CompanyOpen() as Form.Runmodal(Form::"My Work Date") so that this form opens automatically while logging in to a company. And this is working fine in classic.
Code written
Form - OnOpenForm()
WorkDt := WORKDATE;

OKButton - OnPush
WORKDATE(WorkDt);

In RTC the custom page is opening while logging in, but the workdate is not being changed as expected.
Code Written

OnInit()
CurrPage.LOOKUPMODE := TRUE;

OnOpenPage()
WorkDt := WORKDATE;

OnQueryClosePage(CloseAction : Action None) : Boolean
IF CloseAction = ACTION::LookupOK THEN
LookupOKOnPush;

LookUpOkOnPush()
WORKDATE(WorkDt);

What could be the reason?
Sign In or Register to comment.