Where is the logic for AccountAddress entity denormalisation of Address data onto Account and vice versa?

I'm looking for the code/process that does the denormalisation of Account Address entity records created against an Account on to that Account, as well as the code/process that normalises data put on the Account record for address details that get made into Account Address records (or update the existing one, if that's what it does). I haven't been able to find it in event listeners or business processes yet, but I presume it must be in one of those. We need to add some additional new fields to follow the same process, and it would seem sensible to use the same code to do so. We're on 8.1.1.

Like 0

Like

6 comments
Best reply

If you're referring to the code that adds the primary address values to the account (or contact) columns, that is in C# BaseAddressSynchronizer. This code is triggered from the specific address objects (such as AccountAddress) subprocess (open AccountAddress object then click "open process").  

FYI in classic pages there was also code on the page that did this via sandbox messages iirc.

Ryan

If you're referring to the code that adds the primary address values to the account (or contact) columns, that is in C# BaseAddressSynchronizer. This code is triggered from the specific address objects (such as AccountAddress) subprocess (open AccountAddress object then click "open process").  

FYI in classic pages there was also code on the page that did this via sandbox messages iirc.

Ryan

Thanks Ryan, any idea what the correct way to add an additional field to the synchronization process would be? I'm expecting that it would require adding a new C# module that inherits from the BaseAddressSynchronizer class (or maybe the AcountAddressSynchronizer for Account Addresses specifically?) and adds columns to the GetSynchronizationColumnMappings method in the following way:

protected override ICollection<SynchronizationColumnMapping> GetSynchronizationColumnMappings() {
	SynchronizationColumnComparator stringEqualComparator = EqualComparatorProvider.GetStringEqualComparator();
	var baseColumnMappings = base.GetSynchronizationColumnMappings();
	baseColumnMappings.Add(new SynchronizationColumnMapping {
		SourceColumnName = "SrcColName",
		DestinationColumnName = "TgtColName",
		Comparator = stringEqualComparator
	});
	return baseColumnMappings;
}

With the Account Address entity's column name as the source column name and the Account entity's column name as the target column name. Does the entity's subprocess also need editing to make this logic work, or does the GetAddressSynchronizer method used in the existing subprocess automatically include the extra column mappings defined in the override? Can't see where that method comes from.

Harvey Adcock,

 

Hi!

Yes, you need to create a new source code schema, add a new class that inherits from the BaseAddressSynchronizer, and override the GetSynchronizationColumnMappings method.

You may use the AccountAddressSynchronizer class as an example.

To apply the changes to the entity, it is necessary to create a replacing object and update its process methods (to call the overridden method instead of the default one).

Natalia Kalynovska,

 

Hi Natalia, does that require recreating the Process that's attached to the OOTB Account Address entities? As the replacing object in our package doesn't have that process by default, so in order to change it, it seems like we would have to recreate the previous Process with those changes? And does a Process in a replacing object "overwrite" the Process in the replaced object, or do they both still operate? I'm not sure if there's much documentation on the Entity Processes.

 

Thanks,

Harvey

Harvey Adcock,

Hello Harvey,

Have you find a solution to your needs?

No, unfortunately not yet. I didn't end up spending much more time after this thread on it though, it was deprioritised in our project, so it would still be useful if anyone knows how to correctly override entities' Entity Processes.

Show all comments