Easily find this page again using the shortlink: https://bct.azrcrv.co.uk/2103
Table Type: Company
Table Name: O365 Sales Document
Database Table Name: CRONUS UK Ltd_$O365 Sales Document$437dbf0e-84ff-417a-965d-ed2bb9650972
Due to how Dynamics BC tables and columns are named, square brackets need to be wrapped around the table name and column names. Below are example queries showing how O365 Sales Document can be queried.
Show/hide an example select of all columns
SELECT
*
FROM
[CRONUS UK Ltd_$O365 Sales Document$437dbf0e-84ff-417a-965d-ed2bb9650972]
Show/hide an example select of all columns by name
SELECT
[Document Type]
,[Sell-to Customer No_]
,[No_]
,[Due Date]
,[Currency Code]
,[Sell-to Customer Name]
,[Sell-to Contact]
,[Document Date]
,[IsTest]
,[Posted]
,[Currency Symbol]
,[Document Status]
,[Sales Amount]
,[Outstanding Amount]
,[Total Invoiced Amount]
,[Outstanding Status]
,[Document Icon]
,[Payment Method]
,[Display No_]
,[$systemId]
,[$systemCreatedAt]
,[$systemCreatedBy]
,[$systemModifiedAt]
,[$systemModifiedBy]
FROM
[CRONUS UK Ltd_$O365 Sales Document$437dbf0e-84ff-417a-965d-ed2bb9650972]
Show/hide an example select of all columns including those from all joined tables
SELECT
*
FROM
[CRONUS UK Ltd_$O365 Sales Document$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [O365 Sales Document]
LEFT JOIN
[CRONUS UK Ltd_$Sales Header Archive$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [Sales Header Archive]
ON
[O365 Sales Document].[Document Type] = [Sales Header Archive].[Document Type]
AND
[O365 Sales Document].[Document No_] = [Sales Header Archive].[No_]
LEFT JOIN
[CRONUS UK Ltd_$Sales Header$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [Sales Header]
ON
[O365 Sales Document].[Document Type] = [Sales Header].[Document Type]
AND
[O365 Sales Document].[Document No_] = [Sales Header].[No_]
LEFT JOIN
[CRONUS UK Ltd_$Currency$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [Currency]
ON
[O365 Sales Document].[Currency Code] = [Currency].[Code]
LEFT JOIN
[CRONUS UK Ltd_$Customer$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [Customer]
ON
[O365 Sales Document].[Sell-to Customer Name] = [Customer].[Name]
LEFT JOIN
[User] AS [User]
ON
[O365 Sales Document].[SystemCreatedBy] = [User].[User Security ID]
LEFT JOIN
[User] AS [User]
ON
[O365 Sales Document].[SystemModifiedBy] = [User].[User Security ID]
Show/hide columns in O365 Sales Document table
Field No. | Field Name | Field Caption | Class | Type | Length | SQL Column Name | SQL DataType |
---|---|---|---|---|---|---|---|
1 | Document Type | Document Type | Normal | Option | 4 | Document Type | int |
Available options are:
| |||||||
2 | Sell-to Customer No. | Sell-to Customer No. | Normal | Code | 20 | Sell-to Customer No_ | nvarchar(40) |
Key to join to the Customer table.Show/hide example querySELECT [O365 Sales Document].[Sell-to Customer No_] ,[Customer].[No_] FROM [CRONUS UK Ltd_$O365 Sales Document$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [O365 Sales Document] LEFT JOIN [CRONUS UK Ltd_$Customer$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [Customer] ON [O365 Sales Document].[Sell-to Customer No_] = [Customer].[No_] | |||||||
3 | No. | No. | Normal | Code | 20 | No_ | nvarchar(40) |
24 | Due Date | Due Date | Normal | Date | 4 | Due Date | datetime |
32 | Currency Code | Currency Code | Normal | Code | 10 | Currency Code | nvarchar(20) |
Key to join to the Currency table.Show/hide example querySELECT [O365 Sales Document].[Currency Code] ,[Currency].[Code] FROM [CRONUS UK Ltd_$O365 Sales Document$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [O365 Sales Document] LEFT JOIN [CRONUS UK Ltd_$Currency$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [Currency] ON [O365 Sales Document].[Currency Code] = [Currency].[Code] | |||||||
79 | Sell-to Customer Name | Sell-to Customer Name | Normal | Text | 100 | Sell-to Customer Name | nvarchar(200) |
Key to join to the Customer table.Show/hide example querySELECT [O365 Sales Document].[Sell-to Customer Name] ,[Customer].[Name] FROM [CRONUS UK Ltd_$O365 Sales Document$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [O365 Sales Document] LEFT JOIN [CRONUS UK Ltd_$Customer$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [Customer] ON [O365 Sales Document].[Sell-to Customer Name] = [Customer].[Name] | |||||||
84 | Sell-to Contact | Sell-to Contact | Normal | Text | 100 | Sell-to Contact | nvarchar(200) |
99 | Document Date | Document Date | Normal | Date | 4 | Document Date | datetime |
166 | Last Email Sent Time | Last Email Sent Time | FlowField | DateTime | 8 | ||
167 | Last Email Sent Status | Last Email Sent Status | FlowField | Option | 4 | ||
168 | Sent as Email | Sent as Email | FlowField | Boolean | 4 | ||
169 | Last Email Notif Cleared | Last Email Notif Cleared | FlowField | Boolean | 4 | ||
170 | IsTest | IsTest | Normal | Boolean | 4 | IsTest | tinyint |
2100 | Posted | Posted | Normal | Boolean | 4 | Posted | tinyint |
2101 | Canceled | Canceled | FlowField | Boolean | 4 | ||
2102 | Currency Symbol | Currency Symbol | Normal | Text | 10 | Currency Symbol | nvarchar(20) |
2103 | Document Status | Document Status | Normal | Option | 4 | Document Status | int |
Available options are:
| |||||||
2104 | Sales Amount | Sales Amount | Normal | Decimal | 12 | Sales Amount | decimal(38,38) |
2105 | Outstanding Amount | Outstanding Amount | Normal | Decimal | 12 | Outstanding Amount | decimal(38,38) |
2106 | Total Invoiced Amount | Total Invoiced Amount | Normal | Text | 250 | Total Invoiced Amount | nvarchar(500) |
2107 | Outstanding Status | Outstanding Status | Normal | Text | 250 | Outstanding Status | nvarchar(500) |
2108 | Document Icon | Document Icon | Normal | MediaSet | 16 | Document Icon | uniqueidentifier |
2109 | Payment Method | Payment Method | Normal | Code | 10 | Payment Method | nvarchar(20) |
2110 | Display No. | Display No. | Normal | Text | 20 | Display No_ | nvarchar(40) |
2111 | Quote Valid Until Date | Quote Valid Until Date | FlowField | Date | 4 | ||
2112 | Quote Accepted | Quote Accepted | FlowField | Boolean | 4 | ||
2113 | Quote Sent to Customer | Quote Sent to Customer | FlowField | DateTime | 8 | ||
2114 | Quote Accepted Date | Quote Accepted Date | FlowField | Date | 4 | ||
2000000000 | $systemId | System ID | Normal | GUID | 16 | $systemId | uniqueidentifier |
2000000001 | SystemCreatedAt | Created At | Normal | DateTime | 8 | $systemCreatedAt | datetime |
2000000002 | SystemCreatedBy | Created By | Normal | GUID | 16 | $systemCreatedBy | uniqueidentifier |
Key to join to the User table.Show/hide example querySELECT [O365 Sales Document].[$systemCreatedBy] ,[User].[User Security ID] FROM [CRONUS UK Ltd_$O365 Sales Document$437dbf0e-84ff-417a-965d-ed2bb9650972] AS [O365 Sales Document] LEFT JOIN [User] AS [User] ON [O365 Sales Document].[$systemCreatedBy] = [User].[User Security ID] | |||||||
2000000003 | SystemModifiedAt | Modified At | Normal | DateTime | 8 | $systemModifiedAt | datetime |
2000000004 | SystemModifiedBy | Modified By | Normal | GUID | 16 | $systemModifiedBy | uniqueidentifier |