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