Sending alarms for custom items not showing camera view

Hi,

I’m experiencing an issue with the Alarm Manager. When I send an alarm for a custom item that is not a camera, I do not see a camera view in the Alarm Manager, even if I have added a camera to the reference list. How can I resolve this issue?

 private void FireSendAlarmClick(object sender, EventArgs e)
 {
     if (_item == null)
     {
         MessageBox.Show("Please select an Item first...");
         return;
     }
 
     EventSource eventSource = new EventSource()
     {
         FQID = _item.FQID,
         Name = _item.Name
     };
 
     EventHeader eventHeader = new EventHeader()
     {
         ID = Guid.NewGuid(),
         Class = "NewEventToRule",
         Type = _textBoxEventType.Text,
         Timestamp = DateTime.Now,
         Message = _textBoxMessage.Text,
         Name = _textBoxEventName.Text,
         Source = eventSource,
         Priority = 2,
         PriorityName = "Medium"
     };
 
     Item cameraItem = FindAnyCamera(Configuration.Instance.GetItemsByKind(Kind.Camera));
 
     ReferenceList referenceList = new ReferenceList()
     {
         new Reference()
         {
             FQID = _item.FQID
         }
     };
 
     Alarm alarm = new Alarm()
     {
         EventHeader = eventHeader,
         StateName = "In progress",
         State = 4,
         AssignedTo = "test (\\test)",
         ReferenceList = referenceList
         // Basic user with the name of test in this example
         // the string to use can be seen in the Smart Client dropdown
 
         // Other fields could be filled out, e.g. snapshotlist, objectList
     };
 
     // Send the Alarm directly to the EventServer, to store in the Alarm database. No event which could trigger a rule is being activated.
     EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.NewAlarmCommand) { Data = alarm });
 }

Either I have not understood your code or I have detected what the issue is.

From your description _item must be something that is not a camera. You then find cameraItem, but what you put in referenceList is still _item. I think it should have been cameraItem.

If you put a camera in the referenceList do you still observe the same in the Smart Client Alarm Manager?

Hi @Bo Ellegård Andersen (Milestone Systems)​ ,

You were right; I overlooked a clear mistake. I have fixed it, and the camera inside the ReferenceList now pops up.

Thank you very much.