Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Outlook Appointment from NAV, Time defaults to 00:00 in RTC

$
0
0
Hi all,

I have been lurking these forums for a long time and you guys have helped me overcome a lot of issues we were facing, but I did not find anything related to what I am going write next.

I have created a codeunit which you can call from various tables to create Outlook Appointments.
However the Time of the Appointment Item.Start attribute always defaults to midnight (00:00). As a result I cannot really create Appointments automatically for them and I have to pop up the Calendar Window so that they can manually select the time.

Please note this happens only when the Codeunit is called from the RTC Client. If we use the Classic the time is set correctly.

Please find the code below.


IF NOT CREATE(Application,FALSE,TRUE) THEN
EXIT;

char13 :=13;
char10:=10;

//text:= text1 +format(char13)+format(char10)+ text2;


Namespace := Application.GetNamespace('MAPI');
Namespace.Logon;

"Appointment Item" := Application.CreateItem(1);
"Appointment Item".Start(DATI2VARIANT(date,120000T));
"Appointment Item".Subject := Type+ ' - ' + Name+' - ' +"Name 2";
"Appointment Item".Body := 'This is an automated appointment sent from NAV.'+FORMAT(char13) + FORMAT(char10) +
'Phone number(s): ' + "Phone No." + ' . ' + "Mobile Phone No.";
"Appointment Item".Duration := 60;
"Appointment Item".ReminderMinutesBeforeStart := 1;
"Appointment Item".ReminderSet := TRUE;
"Appointment Item".Location := 'Phone';
"Appointment Item".Display;
//"Appointment Item".Save;


Namespace.Logoff;
CLEAR(Application);

As you can see I commented off the "Save" and replaced it with "Display" in order for the window to pop up.
Any kind of input will be appreciated!
I apologise in advance if something is not clear, English is not my first language.

Regards

Constantine

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>