Views [dbo].[CustomerPhoneNumbers_XLedger]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created7:47:33 PM Saturday, February 7, 2026
Last Modified7:48:55 PM Saturday, February 7, 2026
Columns
Name
CustomerNumber
CustomerJoinField
PhoneNumber1
PhoneNumber2
PhoneNumber3
Fax
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
/**
* Do NOT access this view by this view name.  Instead, use the CustomerPhoneNumbers_Synonym which will either
* point to this view or to the CustomerPhoneNumbers_Legacy as appropriate for that system.
*
* IMPORTANT -- READ ON
* ====================
* This view MUST return the same named columns and data types and in the same order as the
* CustomerPhoneNumbers_Legacy view, which is why they can be hot swapped when XLedger is
* activated/deactivated.
*/

create view [dbo].[CustomerPhoneNumbers_XLedger]
(
    CustomerNumber,
    CustomerJoinField,
    PhoneNumber1,
    PhoneNumber2,
    PhoneNumber3,
    Fax
)
as
select
    CustomerNumber = AccountingCustomer.CustomerNumber,
    CustomerJoinField = AccountingCustomer.AccountingCustomerId,
    PhoneNumber1 = case
        when isnull( AccountingCustomer.Phone1, '' ) != '' then AccountingCustomer.Phone1
        else null
    end,
    PhoneNumber2 = case
        when isnull( AccountingCustomer.Phone2, '' ) != '' then AccountingCustomer.Phone2
        else null
    end,
    PhoneNumber3 = case
        when isnull( AccountingCustomer.Phone3, '' ) != '' then AccountingCustomer.Phone3
        else null
    end,
    Fax = case
        when isnull( AccountingCustomer.Fax, '' ) != '' then AccountingCustomer.Fax
        else null
    end
from AccountingCustomer
GO
GRANT SELECT ON  [dbo].[CustomerPhoneNumbers_XLedger] TO [MssExec]
GRANT INSERT ON  [dbo].[CustomerPhoneNumbers_XLedger] TO [MssExec]
GRANT DELETE ON  [dbo].[CustomerPhoneNumbers_XLedger] TO [MssExec]
GRANT UPDATE ON  [dbo].[CustomerPhoneNumbers_XLedger] TO [MssExec]
GO
Uses