-
Send In-App Notification to User D365 Model Driven
C#
Creates and sends a system notification in Dynamics 365
Creates and sends a system notification in Dynamics 365, allowing specification of a title, detailed message, and target user by their unique ID. This ensures the notification is delivered directly to the intended recipient, providing a tailored and efficient communication method within the system.
// Develop a system for sending custom notifications to users based on specific
// events or conditions within Dynamics 365, enhancing user engagement.
public void SendNotification(IOrganizationService service, string title, string message, Guid userId)
{
var notification = new Entity("systemnotification")
{
["title"] = title,
["description"] = message,
["ownerid"] = new EntityReference("systemuser", userId)
};
service.Create(notification);
}