Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (SELECT TOP 1 LogisticsElectronicAddress.Locator
- FROM [AX12].[AX2012R3_PROD].[DBO].LogisticsElectronicAddress
- JOIN [AX12].[AX2012R3_PROD].[DBO].DirPartyLocation
- ON LogisticsElectronicAddress.Location = DirPartyLocation.Location
- AND DirPartyLocation.Party = ContactPerson.Party
- WHERE LogisticsElectronicAddress.Type = 2 --Email
- ORDER BY LogisticsElectronicAddress.IsPrimary DESC
- ) as [EmailAddress], -- NOT MANDATORY, CAN BE NULL
- ISNULL(
- (SELECT TOP 1 LogisticsElectronicAddress.Locator
- FROM [AX12].[AX2012R3_PROD].[DBO].[LogisticsElectronicAddress]
- JOIN [AX12].[AX2012R3_PROD].[DBO].[DirPartyLocation]
- ON [LogisticsElectronicAddress].Location = [DirPartyLocation].Location
- AND [DirPartyLocation].Party = ContactPerson.Party
- WHERE [LogisticsElectronicAddress].IsMobilePhone = 1
- AND [LogisticsElectronicAddress].Type = 100 --lukSMS
- ),
- (SELECT TOP 1 LogisticsElectronicAddress.Locator
- FROM [AX12].[AX2012R3_PROD].[DBO].[LogisticsElectronicAddress]
- JOIN [AX12].[AX2012R3_PROD].[DBO].[DirPartyLocation]
- ON [LogisticsElectronicAddress].Location = [DirPartyLocation].Location
- AND [DirPartyLocation].Party = ContactPerson.Party
- WHERE [LogisticsElectronicAddress].IsMobilePhone = 1
- AND [LogisticsElectronicAddress].Type = 1 --Phone
- )
- ) as [MobilePhone],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement