Account Address Full Address Field - How can I customize its format?
Hi!
In my currently Creatio implementation, the AccountAddress.FullAddress field has the following automatic format:
Zip + Country + State + City + Address
My Client want to make it different:
Address + City + State + ZipCode + Country
Where should I customize that? have not found a business process that does that.
Thank you in advance,
Ignacio Alvarez.
Like
Sadly that is hard coded in the BaseAddressEventListener. I do wish it was configurable in some way - I really dislike having the address values backwards.
Ryan
Sadly that is hard coded in the BaseAddressEventListener. I do wish it was configurable in some way - I really dislike having the address values backwards.
Ryan
+1 for getting more flexibility, depending on the country we see adresses differently , which is often more in the view of "Address + City + State + ZipCode + Country ". The OOTB order is a weird one.
Thank you for your response! I will try creating a BP triggered but the Address change and rewriting there the FullAddress field.
Ignacio.
Ended up implementing a custom AccountAddressEventListener module and modifying the FullAddress field the way I wanted. Thank you again Ryan.
[EntityEventListener(SchemaName = "AccountAddress")]
public class USAAccountAddressEventListener : BaseEntityEventListener
{
#region Methods: Private
private void FillFullAddress(Entity entity) {
entity.LoadLookupDisplayValues();
var zip = entity.GetTypedColumnValue<string>("Zip").Trim();
var region = entity.GetTypedColumnValue<string>("RegionName").Trim();
var city = entity.GetTypedColumnValue<string>("CityName").Trim();
var address = entity.GetTypedColumnValue<string>("Address").Trim();
var fullAddress = new[] { address, city, region, zip }.Where(x => x.IsNotNullOrEmpty());
entity.SetColumnValue("FullAddress", String.Join(", ", fullAddress));
}
#endregion
#region Methods: Public
/// <inheritdoc cref="BaseEntityEventListener.OnInserting"/>
public override void OnInserting(object sender, EntityBeforeEventArgs e) {
base.OnInserting(sender, e);
FillFullAddress(sender as Entity);
}
}
Ignacio Alvarez,
Can you please provide the full steps? How did you make your custom AccountAddressEventListener module? Is this a source code module type? Also, Can you please provide the full script? (I get lots of errors when I try this.
Thanks,
Chani