Hi everyone,
First of all, let me say that I am very new to Dynamics Ax so sorry if this is a stupid question.
So my problem is that I need to setup an email alert when an activity of type "Appointment" is created. The alert should be triggered 1 hour before the appointment is due. I'm not quite sure how to do this as we are not integrating Dynamics with Outlook.
So here is what I managed to do so far:
- I made sure that the "E-mail distributor batch" process was running. To be sure of that I've set an email alert on it to be send when the process has finished. It worked fine and I was receiving emails and pop-ups.
- I manage to somehow create an alert from the code, using something along these lines:
inboxId = EventInbox::nextEventId();
inbox.initValue();
inbox.ShowPopup = NoYes::Yes;
inbox.Subject = "The new activity has been created";
inbox.Message = "Don't forget about it please.";
inbox.SendEmail = true;
inbox.UserId = curUserID();
inbox.AlertTableId = 2271;
inbox.ParentTableId = 2271;
inbox.AlertedFor = "Event: Activity updated";
inbox.EmailRecipient = myEmail@myDomain.com;
inbox.TypeId = classnum(eventTypeDue);
inbox.TypeTrigger = EventTypeTrigger::DueType;
inbox.InboxId = inboxId;
inbox.AlertCreatedDateTime = DateTimeUtil::getSystemDateTime();
inbox.insert();
The code above is creating the alert and I'm getting the popup.
My problem is that in this case the email is not sent...
Also, in this case the alert is sent straight away and I haven't really found a way to delay it to be send at the time I want.
And that's it, I'm stuck there. Does anyone have a solution to my problem?
Also, I had a look at the activities of type "Reminder" but those ones are valid only when integrating with Outlook right?
Thanks for your help.
Regards
*This post is locked for comments