I tested with LibraryEventGenerator sample and it worked without error, so please explore it. I added following code in FireSendAlarmClick in EventForms.cs,
I tested this and it works for me. I am guessing that data in the wrong format could cause the alarm to be unable to send. If you share a snippet of code I could see if I detect something not correct.
My experiment / code -
Alarm alarm = new Alarm()
{
EventHeader = eventHeader,
StateName = "In progress",
State = 4,
AssignedTo = "test (\\test)",
Vendor = new Vendor() { Name = "kjvkzd" },
Description = "Description"
};
Also, we noticed that the sample app executes “EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.NewAlarmCommand) { Data = alarm });” without exceptions but the alarm is not always logged in smart client.
Why does the server log the alarm only some of the time and not all the time?
Try to examine the Event Server logs. Do you see errors to explain that the alarms are not correctly received or used in the Event Server?
(See [c:\ProgramData\Milestone\XProtect](file:c:/ProgramData/Milestone/XProtect) Event Server\logs\ and [c:\ProgramData\Milestone\XProtect](file:c:/ProgramData/Milestone/XProtect) Event Server\logs\MIPLogs\)