Hello,
can anybody help me in writing a codeunit to display current date from online server?
Regards,
David
Hello,
can anybody help me in writing a codeunit to display current date from online server?
Regards,
David
hi ZHU,
i checked your code, however if we are talking on prem environment, possible to display the current date from an online server?
Regards,
David
What is you purpose of getting server date for ?
Hi, As far as I know, the BC SaaS version has no concept of server dates. If you need UTC, I hope the following information can give you some hints.
How to quickly get Coordinated Universal Time (UTC Time)
Thanks.
ZHU
Hi Daniele,
i replaced the function SYSTEMTIME2DATE with DT2DATE it works.
however it is displaying the system date.
means: if i changed the system date to for 5 Apr 2022, it is showing the same not the current date.
Regards,
David
Hi Daniele,
i receive an error for the function SYSTEMTIME2DATE :
"the name does not exist"
Regards,
David
hi
try this:
codeunit 50100 DisplayCurrentDate
{
procedure GetDate()
var
CurrentDate: Date;
begin
CurrentDate := SYSTEMTIME2DATE(CURRENTDATETIME);
MESSAGE('The current date is %1.', CurrentDate);
end;
}
This codeunit contains a procedure called "GetDate" that retrieves the current date and time from the online server using the "CURRENTDATETIME" function. The "SYSTEMTIME2DATE" function is then used to convert the date and time to a date value.
check my answer if it helped you, thanks
DAniele
Please refer the below link, surely it will help you.
there is no code. if you can help me with a code like Hello world standard of VS code.
a page extension or a codeunit that will be called on any page extension.
we can extend Customer List page
Regards,
David
can you please share your code? where you want to display?
On cloud.
but it can works on both right?
Regards,
David
André Arnaud de Cal... 291,391 Super User 2024 Season 2
Martin Dráb 230,445 Most Valuable Professional
nmaenpaa 101,156