Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

AddressType in cls_Address? [Commerce 12.16]

Vote:
 

Hi!

I would like to run a SQL script (not preferable and not recommended, I know!) that removes all shipping addresses with "Box" in Line2. But I don't understand the AddressType in cls_Address. It is a Guid and different for all addresses? I can't find any relation to another table either.

How can I find out which addresses are shipment addresses?

Thanks!

/Kristoffer

#206700
Aug 28, 2019 17:32
Vote:
 

Found out how it works. The table mcmd_SelectedEnumValue is the key.

To get all shipping addresses with Box in Line2 this is your code:

select * from cls_Address c
inner join mcmd_SelectedEnumValue s on s.[Key] = c.AddressType and s.Id = 2
where Line2 like '%box%'

Also described here:
https://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2014/2/Customer-Billing-Address-in-SQL-Query/

/Kristoffer

#206816
Edited, Aug 30, 2019 12:01
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.