ACCOUNTINGELEMENTRELATIONSHIP
                                        This table holds main information about the accounting element relationship.  
                                        Primary Key
                                        
                                            
                                                
                                                    | Primary Key | Field Type | 
                                            
                                            
                                                
                                                    | ID | uniqueidentifier | 
                                            
                                        
                                        Fields
                                        
                                            
                                                
                                                    | Field | Field Type | Null | Notes | Description | 
                                            
                                            
                                                
                                                    | DESCRIPTION | nvarchar(60) |  | Default = '' | User defined description for the relationship rule. | 
                                                
                                                    | CUSTOMIDENTIFIER | nvarchar(100) |  | Default = '' | User-definable custom identifier. | 
                                                
                                                    | SEQUENCEID | int |  |  | Identity column used to increment the default lookupid. | 
                                                
                                                    | DATEADDED | datetime |  | Default = getdate() | Indicates the date this record was added. | 
                                                
                                                    | DATECHANGED | datetime |  | Default = getdate() | Indicates the date this record was last changed. | 
                                                
                                                    | TS | timestamp |  |  | Timestamp. | 
                                                
                                                    | TSLONG | bigint (Computed) | yes | CONVERT(bigint, TS) | Numeric representation of the timestamp. | 
                                                
                                                    | RELATIONSHIPID | nvarchar(60) |  | Default = '' | User defined ID for the relationship rule. | 
                                                
                                                    | LOOKUPID | nvarchar(100) (Computed) | yes | (CASE LEN(CUSTOMIDENTIFIER) WHEN 0 THEN '8-' + CAST(SEQUENCEID AS nvarchar(20)) ELSE CUSTOMIDENTIFIER END) | Unique identifier that supports user defined values as well as system generated values. | 
                                                
                                                    | RESTRICTIONCODE | tinyint |  | Default = 1 | Whether this relationship allows or restricts elements. | 
                                                
                                                    | RESTRICTION | nvarchar(55) (Computed) | yes | CASE [RESTRICTIONCODE] WHEN 1 THEN N'Allow use of selected elements with basis element(s)' WHEN 2 THEN N'Restrict use of selected elements with basis element(s)' END | Provides a translation for the 'RESTRICTIONCODE' field. | 
                                            
                                        
                                        Foreign Keys
                                        
                                            
                                                
                                                    | Foreign Key | Field Type | Null | Notes | Description | 
                                            
                                            
                                                
                                                    | BASEELEMENTACCOUNTSTRUCTUREID | uniqueidentifier |  | PDACCOUNTSTRUCTURE.ID | Refers to the accounting element this represents. | 
                                                
                                                    | ADDEDBYID | uniqueidentifier |  | CHANGEAGENT.ID | FK to CHANGEAGENT. | 
                                                
                                                    | CHANGEDBYID | uniqueidentifier |  | CHANGEAGENT.ID | FK to CHANGEAGENT. | 
                                            
                                        
                                        Indexes
                                        
                                            
                                                
                                                    | Index Name | Fields | Unique | Primary | Clustered | 
                                            
                                            
                                                
                                                    | IX_ACCOUNTINGELEMENTRELATIONSHIP_BASEELEMENTACCOUNTSTRUCTUREID | BASEELEMENTACCOUNTSTRUCTUREID |  |  |  | 
                                                
                                                    | IX_ACCOUNTINGELEMENTRELATIONSHIP_DATEADDED | DATEADDED |  |  | yes | 
                                                
                                                    | IX_ACCOUNTINGELEMENTRELATIONSHIP_DATECHANGED | DATECHANGED |  |  |  | 
                                                
                                                    | PK_ACCOUNTINGELEMENTRELATIONSHIP | ID | yes | yes |  | 
                                                
                                                    | UC_ACCOUNTINGELEMENTRELATIONSHIP_DESCRIPTION | DESCRIPTION | yes |  |  | 
                                                
                                                    | UC_ACCOUNTINGELEMENTRELATIONSHIP_LOOKUPID | LOOKUPID | yes |  |  | 
                                                
                                                    | UC_ACCOUNTINGELEMENTRELATIONSHIP_RELATIONSHIPID | RELATIONSHIPID | yes |  |  | 
                                            
                                        
                                        Triggers
                                        
                                        Referenced by