Question

Contact OnSaved Event doesn't fire in the Event Layer

Hi

 

I'm trying to use the Entity Event Layer for the contact object:

using System;
using System.Collections.Generic;
using Terrasoft.Core.Entities;
using Terrasoft.Core.Entities.Events;
using Terrasoft.Core;
using Terrasoft.Core.DB;
 
namespace Terrasoft.Configuration
{	
    [EntityEventListener(SchemaName = "Contact")]
    public class ContactEntityEventListener : BaseEntityEventListener
    {
	    public override void OnSaving(object sender, EntityBeforeEventArgs e)
        {
			base.OnSaving(sender, e);
		}
 
        public override void OnSaved(object sender, EntityAfterEventArgs e)
        {
			base.OnSaved(sender, e);
        }
     }
}

It works fine for both Saving and Saved events except for Communication Fileds (MobilePhone, Email, etc..) I only get the OnSaving Event.

The OnSaved event doesn't fire at all for these fields.

 

Is this related to Contact - Communication Option Synchronizer?

How can I get the OnSaved event in the Event Layer? I don't want to use the Business process for this task.

 

Thank you

Mohamed

Like 0

Like

4 comments

Hi Mohamed,

 

Saving the contact event when modifying either email or mobile phone number triggers the listener (in the example below the mobile phone number modification triggered the method):

In case you save changes to the contact communication detail then you need to create a separate listener for the ContactCommunication entity.

 

Best regards,

Oscar

Oscar Dylan,

 

Yes, it does for the OnSaving event. But it doesn't fire for the OnSaved event.

 

Thanks!

Mohamed Ouederni,

 

It also triggers the OnSaved event, please see (tested either for emails and mobile phone):

Best regards,

Oscar

Oscar Dylan,

 

There is this method clearChangedValuesSynchronizedByDetail in Terrasoft.CommunicationSynchronizerMixin removes the synced communication fields.

 

What is the best way to disable this feature?

 

Thank you

Mohamed

Show all comments