pramod.gupta

Error in setting auto acknowledgement

Discussion created by pramod.gupta on Apr 23, 2012
Latest reply on Apr 30, 2012 by hanyong

Hello Everyone,

 

To set auto acknowledgement to true/False, I wrote the following code.

 

AFNotification notification = this.AfDatabaseAccess.GetNotification(notificationName);

 

notification.CheckOut();
                if (autoacknowledgementSetting.IsAutoacknowledged)
                {
                    notification.MinimumAcknowledgements = 0;
                    foreach (AFNotificationContact afnotificationContact in notification.NotificationContacts)
                    {
                        if (afnotificationContact.ContactType == AFNotificationContactType.Group)
                        {
                            afnotificationContact.MinimumAcknowledgements = 0;
                        }
                    }
                }
                else
                {
                    notification.MinimumAcknowledgements = 1;
                    foreach (AFNotificationContact afnotificationContact in notification.NotificationContacts)
                    {
                        if (afnotificationContact.ContactType == AFNotificationContactType.Group)
                        {
                            afnotificationContact.MinimumAcknowledgements = 1;
                        }
                    }
                }
                notification.CheckIn();

 

 But When checking the notification, I got the error  as:

 

Unexpected Server Error: 'An item with the same key has already been added.'. Use Event Viewer to see the AF service log file for more information.

 

Could you let me know why this error comes.

 

-Pramod

Outcomes