Table

RetailSalesTableHistory

Commerce sales orders

Holds retail details for a commerce sales order, such as channel, store, register, loyalty card and discount data. Each record points to one sales order through a reference to SalesTable. It also has payment type, product list and country-specific tax fields for India and Mexico.

Table name
RetailSalesTableHistory
Module
Commerce transactions and orders
Table group
Miscellaneous
Table type
Regular
Data per company
Yes
Configuration key
Retail
Primary index
None
Replacement key
None
Key fields
None
Model
Foundation

Fields (38)

Field and descriptionType / EDT / enumMandatoryReferencesIn public entities
ChannelReferenceIdReference code the sales channel uses for this order.String (50)
RetailOrderChannelReferenceId
NoNone
CouponsStored list of coupons linked to the order.Container
RetailCoupons
NoNone
CreditCardTenderTypeIdID of the payment method used.String
RetailStoreTenderTypeId
NoNone
CreditCardTypeIdID of the card type used for payment.String
RetailStoreCardTypeId
NoNone
DataAreaIdThe company (legal entity) that the record belongs to. System field.String (4)
DataAreaId
NoNone
DiscountCodesStored list of discount codes linked to the order.Container
RetailDiscountCodes
NoNone
GSTTransactionId_INGST transaction ID of the invoice, used for India.String (50)
TaxTransactionId_IN
NoNone
GSTTransactionIdFromPOS_INYes/no flag used for India. It appears to show whether the GST transaction ID came from the point of sale.low confidenceEnum
NoYes (enum)
NoNone
InitialReceiptIdReceipt number first created for the order in the point of sale app.String (18)
RetailInitialReceiptId
NoNone
IsPriceAndDiscountRecalculationRequiredYes/no flag showing whether prices and discounts need to be recalculated.Enum
NoYes (enum)
NoNone
IsTaxExemptedForPriceInclusiveYes/no flag showing whether tax was exempted where prices include tax.Enum
RetailIsTaxExemptedForPriceInclusive
NoYes (enum)
NoNone
OMInternalOrganizationReference to the internal organisation linked to the order.Int64
RefRecId
NoNone
OriginalTransactionTimeDate and time of the original transaction, stored in UTC.UtcDateTime
TransDateTime
NoNone
OriginChannelReference to the channel where the order originated. No related table is given.low confidenceInt64
RefRecId
NoNone
PartitionA system field for the data partition. In most environments every record has the same value. System field.Int64
Partition
NoNone
PaymentsTypeKind of payments used on the order: Legacy, Commerce or Call Center.Enum
RetailPaymentsType (enum)
NoNone
RecIdA unique number that the system gives to every record. Other tables often use it to point to this record. System field.Int64
RecId
NoNone
RecVersionA system number that changes each time the record is updated. It is used to detect conflicting updates. System field.Integer
RecVersion
NoNone
RetailCFDIDocumentType_MXCFDI document type, either Global or Normal, used for Mexico.Enum
RetailCFDIDocumentType_MX (enum)
NoNone
RetailChannelReference to the retail channel of the order.Int64
RefRecId
NoNone
RetailHourOfDayReference to the hour-of-day record for the order.Int64
RefRecId
NoNone
RetailLoyaltyCardReference to the loyalty card linked to the order.Int64
RefRecId
NoNone
RetailOrderYes/no flag showing whether the record is a retail one.Enum
NoYes (enum)
NoNone
RetailPrepaymentOverriddenYes/no flag showing whether the prepayment was overridden.Enum
NoYesId
NoYes (enum)
NoNone
RetailProductListUpdateIdID of the product list.String (40)
RetailProductListId
NoNone
RetailProductListUpdateNameName of the product list.String (250)
RetailProductListName
NoNone
RetailReplenishmentLocationIdCode of the warehouse linked to the order.String
SalesInventLocationId
NoNone
RetailRetailStatusTypeRetail status of the order, for example Document, Sent, Part receipt, Closed or Canceled.Enum
RetailRetailStatusType
RetailRetailStatusTypeBase (enum)
NoNone
RetailStoreIdNumber of the store linked to the order.String
RetailStoreId
NoNone
RetailTerminalIdNumber of the POS register linked to the order.String
RetailTerminalId
NoNone
SalesTablePoints to the sales order this retail data belongs to.Int64
RefRecId
NoSalesTable.RecIdNone
ShouldUseUnifiedPricingEngineOnSalesOrderYes/no flag for using the unified pricing engine on the order.Enum
NoYes (enum)
NoNone
StatementIdNumber of the retail statement linked to the order.String (20)
RetailStatementId
NoNone
TableIdA system number that identifies the table. System field.Integer
TableId
NoNone
TaxOverrideCodeCode that replaces the normal sales tax handling.String (25)
RetailTaxOverrideCode
NoNone
TmpPriceDiscountDataStored transaction data used for price and discount handling.low confidenceContainer
RetailTransactionDataEx3
NoNone
TotalManualDiscountAmountTotal cash discount amount entered manually.Real
DiscAmount
NoNone
TotalManualDiscountPercentageTotal discount percentage entered manually.Real
DiscPct
NoNone

Indexes (1)

Relations (1)

Each relation joins RetailSalesTableHistory to another table on the fields shown.

  • SalesTable → SalesTable

    Join on SalesTable = SalesTable.RecId

    Zero or one RetailSalesTableHistory record → exactly one SalesTable record

Get this data out

No public entity reads from RetailSalesTableHistory. Its data is only reachable through the application, a custom entity or a database export.

Need help with RetailSalesTableHistory in a report, an integration or a migration? Talk to Dr Dynamics.

Email sales@drdynamics.co.uk