Re: Trying to put causeList into an event (Problem)

Notification->Causes is Reference List; So assigning it as string format won’t work.

Sample would be;

// get instance of existing notification;

icsNotificationFactoryObj = object(“ICS_NotificationFactory”, “ICS-NotificationFactory”);

// get the problem;

icsProblemNotif = icsNotificationFactoryObj->findNotification(“className”,”instanceName”,”eventName”);

// get the problem’s existing causedBy List

existingCausedByList = icsProblemNotif->CausedBy;

// get the notification to be added;

eventTobeadded = icsNotificationFactoryObj->findNotification(“className”, “instanceName”, “eventName”);

// add it to the problem

existingCausedByList += eventTobeadded;

icsProblemNotif->CausedBy = existingCausedByList;



When assigning to Causes you need to use += since it is a relationshipset. Also you be checking your object handles with the isNull method each time.



Kind Regards,


Sean

Related:

Leave a Reply