Views [dbo].[CustomerInformation_XLedger]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Created3:09:14 PM Tuesday, June 24, 2025
Last Modified3:09:14 PM Tuesday, June 24, 2025
Columns
Name
CustomerNumber
CustomerName
OnHold
NoCreditFlag
CreditLimit
Inactive
CustomerClass
City
State
CustomerId
CustomerJoinField
Hold
TaxExempt
Permissions
TypeActionOwning Principal
GrantDeleteMssExec
GrantInsertMssExec
GrantSelectMssExec
GrantUpdateMssExec
SQL Script
/**
* Do NOT access this view by this view name.  Instead, use the CustomerInformation_Synonym which will either
* point to this view or to the CustomerInformation_Legacy as appropriate for that system.
*/

create view [dbo].[CustomerInformation_XLedger]
(
    CustomerNumber,
    CustomerName,
    OnHold,
    NoCreditFlag,
    CreditLimit,
    Inactive,
    CustomerClass,
    City,
    [State],
    CustomerId,
    CustomerJoinField,
    Hold,
    TaxExempt
)
as
select
    CustomerNumber = AccountingCustomer.CustomerNumber,
    CustomerName = AccountingCustomer.[Name],
    OnHold = case
        when AccountingCustomer.OnHold = 1 and AccountingCustomer.Hidden = 1 then 'On Hold, Inactive'
        when AccountingCustomer.OnHold = 1 then 'On Hold'
        when AccountingCustomer.Hidden = 1 then 'Inactive'
        else ''
    end,
    NoCreditFlag = AccountingCustomer.NoCreditFlag,
    CreditLimit = AccountingCustomer.CreditLimit,
    Inactive = AccountingCustomer.Hidden,
    CustomerClass = AccountingCustomerClass.ClassCode,
    --[Address] = AccountingCustomerAddress.[Address1],
    --[Address2] = AccountingCustomerAddress.[Address2],
    --[Address3] = AccountingCustomerAddress.[Address3],
    City = AccountingCustomerAddress.City,
    [State] = AccountingCustomerAddress.[State],
    --PostalCode = AccountingCustomerAddress.PostalCode,
    --CountryName = CountryCodeStandard.VanlineCountryCode,
    CustomerId = AccountingCustomer.AccountingCustomerId,
    --CustomerAddressId = AccountingCustomerAddress.AccountingCustomerAddressId,
    CustomerJoinField = AccountingCustomer.AccountingCustomerId,
    Hold = AccountingCustomer.OnHold,
    --Contact = AccountingCustomer.Contact,
    TaxExempt = AccountingCustomer.TaxExempt
    --CountryCodeStandardFID = AccountingCustomerAddress.CountryCodeStandardFID
from AccountingCustomer
inner join AccountingCustomerAddressType on AccountingCustomerAddressType.TypeName = dbo.GetDefaultAccountingCustomerAddressTypeName()
left outer join AccountingCustomerAddress on AccountingCustomerAddress.AccountingCustomerFid = AccountingCustomer.AccountingCustomerId and
    AccountingCustomerAddress.AccountingCustomerAddressTypeFid = AccountingCustomerAddressType.AccountingCustomerAddressTypeId
left outer join CountryCodeStandard on CountryCodeStandard.CountryCodeStandardID = AccountingCustomerAddress.CountryCodeStandardFID
left outer join AccountingCustomerClass on AccountingCustomerClass.AccountingCustomerClassId = AccountingCustomer.AccountingCustomerClassFid
GO
GRANT SELECT ON  [dbo].[CustomerInformation_XLedger] TO [MssExec]
GRANT INSERT ON  [dbo].[CustomerInformation_XLedger] TO [MssExec]
GRANT DELETE ON  [dbo].[CustomerInformation_XLedger] TO [MssExec]
GRANT UPDATE ON  [dbo].[CustomerInformation_XLedger] TO [MssExec]
GO
Uses