Я пытаюсь создать простой запрос между компаниями между VendTrans и VendTable. У нас включена глобальная адресная книга, поэтому некоторые записи являются общими для всех компаний. Если бы я писал SQL, он бы выглядел так:
select vtxn.Voucher, vtxn.TransDate, vt.AccountNum, vt.Name
from dbo.vendtrans vtxn
join dbo.vendtable vt on vtxn.accountnum = vt.accountnum
and vt.dataareaid in (vtxn.dataareaid, 'shr')
Проблема, с которой я сталкиваюсь, заключается в том, что из-за глобальной адресной книги я не получаю результатов из запроса и представления, определенных ниже. Буду признателен за любую помощь.
Спасибо.
QUERY #spTestQuery
PROPERTIES
Name #spTestQuery
UserUpdate #No
Version #524
NextUniqueId #1008
AllowCrossCompany #Yes
ENDPROPERTIES
METHODS
Version: 3
SOURCE #classDeclaration
#public class QueryRun extends ObjectRun
#{
#}
ENDSOURCE
ENDMETHODS
BLOCKS
BLOCK #LedgerJournalTrans
PROPERTIES
Name #LedgerJournalTrans_1
Table #LedgerJournalTrans
UniqueId #1000
FirstFast #Yes
AllowAdd #No fields
ENDPROPERTIES
FIELDLIST
PROPERTIES
Dynamic #No
ENDPROPERTIES
FIELD #BankChequeNum
FIELD #TransDate
ENDFIELDLIST
SORTING
ENDSORTING
LINES
LINE #BankChequeNum
PROPERTIES
Name #BankChequeNum
Table #LedgerJournalTrans
Field #BankChequeNum
Value #> 0
ENDPROPERTIES
ENDLINES
BLOCKS
BLOCK #VendTrans
PROPERTIES
Name #VendTrans_1
Table #VendTrans
UniqueId #1003
AllowAdd #No fields
FetchMode #1:1
Relations #Yes
ENDPROPERTIES
FIELDLIST
PROPERTIES
Dynamic #No
ENDPROPERTIES
FIELD #AccountNum
FIELD #LastSettleVoucher
ENDFIELDLIST
SORTING
ENDSORTING
LINES
ENDLINES
BLOCKS
BLOCK #VendTable
PROPERTIES
Name #VendTable_1
Table #VendTable
UniqueId #1004
Relations #Yes
Enabled #No
ENDPROPERTIES
FIELDLIST
PROPERTIES
Dynamic #No
ENDPROPERTIES
FIELD #Name
FIELD #AccountNum
ENDFIELDLIST
SORTING
ENDSORTING
LINES
ENDLINES
BLOCKS
ENDBLOCKS
ASSOCIATIONS
ASSOCIATION
MASTERFIELD #AccountNum
DETAILSFIELD #AccountNum
ENDASSOCIATIONS
ENDBLOCK
ENDBLOCKS
ASSOCIATIONS
ASSOCIATION
MASTERFIELD #AccountNum
DETAILSFIELD #AccountNum
ENDASSOCIATIONS
ENDBLOCK
BLOCK #LedgerTrans
PROPERTIES
Name #LedgerTrans_1
Table #LedgerTrans
UniqueId #1005
AllowAdd #No fields
FetchMode #1:1
Relations #Yes
ENDPROPERTIES
FIELDLIST
PROPERTIES
Dynamic #No
ENDPROPERTIES
FIELD #AccountNum
FIELD #Voucher
FIELD #AmountMST
FIELD #TransDate
FIELD #Voucher
FIELD #Dimension
ENDFIELDLIST
SORTING
ENDSORTING
LINES
LINE #AccountNum
PROPERTIES
Name #AccountNum
Table #LedgerTrans
Field #AccountNum
Value #!211000
ENDPROPERTIES
ENDLINES
BLOCKS
BLOCK #LedgerTable
PROPERTIES
Name #LedgerTable_1
Table #LedgerTable
UniqueId #1006
AllowAdd #No fields
Relations #Yes
ENDPROPERTIES
FIELDLIST
PROPERTIES
Dynamic #No
ENDPROPERTIES
FIELD #AccountName
FIELD #AccountNum
ENDFIELDLIST
SORTING
ENDSORTING
LINES
ENDLINES
BLOCKS
ENDBLOCKS
ASSOCIATIONS
ASSOCIATION
MASTERFIELD #AccountNum
DETAILSFIELD #AccountNum
ENDASSOCIATIONS
ENDBLOCK
BLOCK #Dimensions
PROPERTIES
Name #Dimensions_1
Table #Dimensions
UniqueId #1007
AllowAdd #No fields
ENDPROPERTIES
FIELDLIST
PROPERTIES
Dynamic #No
ENDPROPERTIES
FIELD #Description
FIELD #Num
FIELD #DimensionCode
ENDFIELDLIST
SORTING
ENDSORTING
LINES
LINE #DimensionCode
PROPERTIES
Name #DimensionCode
Table #Dimensions
Field #DimensionCode
Value #Purpose
ENDPROPERTIES
ENDLINES
BLOCKS
ENDBLOCKS
ASSOCIATIONS
ASSOCIATION
JOINDATASOURCE #LedgerTrans_1
MASTERFIELD #Dimension[3]
DETAILSFIELD #Num
ENDASSOCIATIONS
ENDBLOCK
ENDBLOCKS
ASSOCIATIONS
ASSOCIATION
MASTERFIELD #TransDate
DETAILSFIELD #TransDate
ASSOCIATION
MASTERFIELD #Voucher
DETAILSFIELD #Voucher
ENDASSOCIATIONS
ENDBLOCK
ENDBLOCKS
GROUPBY
ENDGROUPBY
ORDERBY
ENDORDERBY
ENDBLOCK
ENDBLOCKS
DEPENDENTS
DEPENDENT
PROPERTIES
Name #spTestView
DependentType #View
ENDPROPERTIES
Id 50005
ENDDEPENDENTS
COMPOSITEQUERIES
ENDCOMPOSITEQUERIES
ENDQUERY
VIEW #spVendTestView
Id 50008
PROPERTIES
Name #spVendTestView
SaveDataPerCompany #Yes
Query #spvendtest
ENDPROPERTIES
QUERY #Metadata
PROPERTIES
Name #Metadata
AllowCrossCompany #Yes
ENDPROPERTIES
BLOCKS
ENDBLOCKS
QUERY #spVendTest
ENDQUERY
ENDQUERY
FIELDS
VIEWFIELD #Voucher
Id 50001
PROPERTIES
Name #Voucher
Table #spVendTestView
ExtendedDataType #Voucher
StringSize #25
DataSource #VendTrans_1
DataField #Voucher
ENDPROPERTIES
ENDVIEWFIELD
VIEWFIELD #TransDate
Id 50003
PROPERTIES
Type #Date
Name #TransDate
Table #spVendTestView
ExtendedDataType #TransDate
StringSize #(Memo)
DataSource #VendTrans_1
DataField #TransDate
ENDPROPERTIES
ENDVIEWFIELD
VIEWFIELD #AccountNum
Id 50004
PROPERTIES
Name #AccountNum
Table #spVendTestView
ExtendedDataType #VendAccount
StringSize #20
DataSource #VendTable_1
DataField #AccountNum
ENDPROPERTIES
ENDVIEWFIELD
VIEWFIELD #Name
Id 50002
PROPERTIES
Name #Name
Table #spVendTestView
ExtendedDataType #VendName
StringSize #120
DataSource #VendTable_1
DataField #Name
ENDPROPERTIES
ENDVIEWFIELD
ENDFIELDS
GROUPS
ENDGROUPS
ENDVIEW