Wednesday, October 11, 2023

Get system notification in D365FO

 


  SystemNotificationDataContract notification = new SystemNotificationDataContract();

        notification.Users().value(1, curUserId());

        notification.Title("Delete Operation ended");

        notification.RuleId('StagingCleanup');

        notification.Message(strfmt("Deleted %1 records from TestTable and Total time consumed: %2",countRecord, timeConsumed(fromTime, timeNow())));

        notification.ExpirationDateTime(DateTimeUtil::addHours(DateTimeUtil::utcNow(), 48));


        SystemNotificationsManager::AddSystemNotification(notification);

No comments:

Post a Comment