Table
MainAccount
Main account
Holds the main accounts of a chart of accounts. It is keyed by main account ID and chart of accounts. Each record carries the name, account type, posting and currency settings, validation choices, and links to related accounts such as parent, offset and opening accounts. It also includes fields used for Mexico, Brazil and Spain.
- Table name
MainAccount- Module
Financial dimensions- Table group
Main- Table type
Regular- Data per company
No- Configuration key
LedgerBasic- Primary index
RecId- Replacement key
MainAccountIdIdx- Key fields
MainAccountId, LedgerChartOfAccounts- Model
Ledger
Fields (47)
| Field and description | Type / EDT / enum | Mandatory | References | In public entities |
|---|---|---|---|---|
MainAccountIdMain account number, part of the key. | String (20)MainAccountNum | Yes | MainAccountEntityMainAccountEntityMainAccountEntityand 37 more | |
LedgerChartOfAccountsPoints to the chart of accounts that the account belongs to. | Int64RefRecId | Yes | LedgerChartOfAccounts.RecId | MainAccountEntityDimAttributeMainAccountEntityMainAccountBiEntityand 17 more |
AccountCategoryRefPoints to the main account category of the account. | IntegerAccountCategoryRef | No | MainAccountCategory.AccountCategoryRef | MainAccountEntityMainAccountBiEntityMainAccountCDREntity |
AdjustmentMethod_MXAdjustment method for the account, such as transaction date or monthly balance. Used for Mexico. | EnumAdjustmentMethod_MX (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
CloseTypeClose type of the account: not applicable, real, nominal or nominal with no close. | EnumAccountCloseType (enum) | No | MainAccountBiEntityMainAccountCDREntity | |
ClosingClosing choice for the account: none, result, balance or capital. | EnumLedgerClosing (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
ConsolidationMainAccountDefault main account used for consolidation, as text. | String (20)LedgerConsolidateMainAccount | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
CreatedByThe user who created the record. System field. | String (20)CreatedBy | No | MainAccountBiEntity | |
CreatedDateTimeThe date and time when the record was created. System field. | UtcDateTimeCreatedDateTime | No | MainAccountBiEntityMainAccountCDREntity | |
CurrencyCodeCurrency code linked to the account. | String (3)CurrencyCode | No | Currency.CurrencyCode | MainAccountEntityMainAccountBiEntityMainAccountCDREntity |
DebitCreditBalanceDemandBalance control choice: none, debit or credit. | EnumDebCredBalanceDemandDebCredProposal (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
DebitCreditCheckDebit or credit requirement for the account: none, debit or credit. | EnumDebCredProposal (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
DebitCreditProposalDebit or credit side suggested for the account: none, debit or credit. | EnumDebCredProposal (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
ExchangeAdjustedYes/no flag for foreign currency revaluation of the account. | EnumNoYes (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
ExchangeAdjustmentRateTypePoints to the exchange rate type used for adjustment. | Int64ExchangeRateTypeRecId | No | ExchangeRateType.RecId | MainAccountEntityMainAccountBiEntityMainAccountCDREntity |
FinancialReportingExchangeRateTypePoints to the exchange rate type used for financial reporting. | Int64ExchangeRateTypeRecId | No | ExchangeRateType.RecId | MainAccountEntityMainAccountBiEntityMainAccountCDREntity |
FinancialReportingTranslationTypeCurrency translation type for reporting: weighted average, average, current or transaction date. | EnumFinancialReportingTranslationType (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
InflationAdjustment_MXYes/no flag for the B-10 inflation adjustment. Used for Mexico. | EnumInflationAdjustment_MXNoYes (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
MainAccountTemplatePoints to the main account template linked to the account. | Int64RefRecId | No | MainAccountTemplate.RecId | MainAccountBiEntityMainAccountCDREntity |
MandatoryPaymentReferenceYes/no flag that shows whether a payment reference is mandatory. | EnumNoYes (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
ModifiedByThe user who last changed the record. System field. | String (20)ModifiedBy | No | MainAccountBiEntity | |
ModifiedDateTimeThe date and time when the record was last changed. System field. | UtcDateTimeModifiedDateTime | No | MainAccountBiEntityMainAccountCDREntity | |
MonetaryYes/no flag that shows whether the account is monetary. | EnumLedgerMonetaryNoYes (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
NameName of the main account. | String (60)AccountName | Yes | MainAccountEntityDimAttributeMainAccountEntityMainAccountBiEntityand 7 more | |
NatureCode_BRTwo-character nature code of the account. Used for Brazil. | String (2)NatureCode_BR | No | MainAccountEntityMainAccountCDREntity | |
OffsetLedgerDimensionPoints to a dimension code combination used as the offset account. | Int64LedgerDimensionDefaultAccount | No | DimensionAttributeValueCombination.RecId | MainAccountEntityMainAccountBiEntityMainAccountCDREntity |
OpeningAccountPoints to another main account used as the opening account. | Int64MainAccountRecId | No | MainAccount.RecId | MainAccountBiEntityMainAccountCDREntity |
ParentMainAccountPoints to the parent main account. | Int64MainAccountRecId | No | MainAccount.RecId | MainAccountBiEntityMainAccountCDREntity |
ParentMainAccount_BRReference to the parent account. Used for Brazil. | Int64RefRecId | No | None | |
PartitionA system field for the data partition. In most environments every record has the same value. System field. | Int64Partition | No | None | |
PostingTypePosting type assigned to the account, such as exchange rate gain, sales tax or allocation. | EnumLedgerPostingType (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
RecIdA unique number that the system gives to every record. Other tables often use it to point to this record. System field. | Int64RecId | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntityand 3 more | |
RecVersionA system number that changes each time the record is updated. It is used to detect conflicting updates. System field. | IntegerRecVersion | No | MainAccountBiEntity | |
RepomoType_MXREPOMO type: not applicable, asset or liability. Used for Mexico. | EnumRepomoType_MX (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
ReportingAccountTypeReporting type of the account, such as none, header, empty header or page header. | EnumDimensionLedgerAccountReportingType (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
ReportingExchangeAdjustmentRateTypePoints to the exchange rate type for adjusting in the reporting currency. | Int64ExchangeRateTypeRecId | No | ExchangeRateType.RecId | MainAccountEntityMainAccountBiEntityMainAccountCDREntity |
SRUCodeSRU code of the account (up to 4 characters). | String (4)LedgerSRUCode | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
StandardMainAccount_WPoints to the standard general ledger account. | Int64RefRecId | No | StandardMainAccount_W.RecId | MainAccountBiEntityMainAccountCDREntity |
SysRowVersionA system row version number that is used for change tracking. System field. | Int64SysRowVersion | No | None | |
TableIdA system number that identifies the table. System field. | IntegerTableId | No | None | |
TransferYearEndAccount_ESPoints to the main account used for transferring the year-end result. Used for Spain. | Int64MainAccountRecId | No | MainAccount.RecId | MainAccountBiEntityMainAccountCDREntity |
TypeMain account type, such as profit and loss, revenue, expense, balance sheet or asset. | EnumDimensionLedgerAccountType (enum) | No | MainAccountEntityDimAttributeMainAccountEntityMainAccountBiEntityand 2 more | |
UnitOfMeasurePoints to the unit of measure linked to the account. | Int64UnitOfMeasureRecId | No | UnitOfMeasure.RecId | MainAccountBiEntityMainAccountCDREntity |
UserInfoIdUser ID linked to the account.low confidence | StringUserId | No | MainAccountEntityMainAccountBiEntity | |
ValidateCurrencyRule for the currency code: optional, required, or limited to one or several valid options. | EnumFieldControl (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
ValidatePostingRule for validating posting: optional, required, or limited to one or several valid options. | EnumFieldControl (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity | |
ValidateUserRule for the user: optional, required, or limited to one or several valid options. | EnumFieldControl (enum) | No | MainAccountEntityMainAccountBiEntityMainAccountCDREntity |
Indexes (5)
MainAccountIdIdxReplacement keyMainAccountId,LedgerChartOfAccountsUnique, alternate key.
MainAccountAndAdjustmentMethodIdx_MXMainAccountId,AdjustmentMethod_MXNot unique.
LedgerChartOfAccountsTypeIdxLedgerChartOfAccounts,Type,MainAccountId,NameNot unique.
OffsetLedgerDimensionTypeIdxOffsetLedgerDimension,Type,RecIdNot unique.
AccountCategoryRefTypeIdxAccountCategoryRef,Type,RecIdNot unique.
Relations (14)
Each relation joins MainAccount to another table on the fields shown.
Currency→CurrencyJoin on
CurrencyCode = Currency.CurrencyCodeMany MainAccount records → zero or one Currency record
FinancialReportingExchangeRateType→ExchangeRateTypeJoin on
FinancialReportingExchangeRateType = ExchangeRateType.RecIdMany MainAccount records → zero or one ExchangeRateType record
LedgerChartOfAccounts→LedgerChartOfAccountsJoin on
LedgerChartOfAccounts = LedgerChartOfAccounts.RecIdMany MainAccount records → exactly one LedgerChartOfAccounts record
MainAccountCategory→MainAccountCategoryJoin on
AccountCategoryRef = MainAccountCategory.AccountCategoryRefMany MainAccount records → zero or one MainAccountCategory record
OffsetLedgerDimension→DimensionAttributeValueCombinationJoin on
OffsetLedgerDimension = DimensionAttributeValueCombination.RecIdMany MainAccount records → zero or one DimensionAttributeValueCombination record
OpeningAccount→MainAccountJoin on
OpeningAccount = MainAccount.RecIdMany MainAccount records → zero or one MainAccount record
ParentMainAccount→MainAccountJoin on
ParentMainAccount = MainAccount.RecIdMany MainAccount records → zero or one MainAccount record
TransferYearEndAccount_ES→MainAccountJoin on
TransferYearEndAccount_ES = MainAccount.RecIdMany MainAccount records → zero or one MainAccount record
UnitOfMeasure→UnitOfMeasureJoin on
UnitOfMeasure = UnitOfMeasure.RecIdMany MainAccount records → zero or one UnitOfMeasure record
UserInfo→UserInfoJoin on
UserInfoId = UserInfo.idMany MainAccount records → zero or one UserInfo record
ExchangeAdjustmentRateType→ExchangeRateTypeJoin on
ExchangeAdjustmentRateType = ExchangeRateType.RecIdMany MainAccount records → zero or one ExchangeRateType record
ReportingExchangeAdjustmentRateType→ExchangeRateTypeJoin on
ReportingExchangeAdjustmentRateType = ExchangeRateType.RecIdMany MainAccount records → zero or one ExchangeRateType record
MainAccountTemplate→MainAccountTemplateJoin on
MainAccountTemplate = MainAccountTemplate.RecIdMany MainAccount records → zero or one MainAccountTemplate record
StandardMainAccount_W→StandardMainAccount_WJoin on
StandardMainAccount_W = StandardMainAccount_W.RecIdMany MainAccount records → zero or one StandardMainAccount_W record
Get this data out
Tables are not exposed directly. These public entities read from MainAccount; use one of them in Power BI, Power Platform or a data management project.
MainAccountEntity· 33 fields from this tableDimAttributeMainAccountEntity· 4 fields from this tableMainAccountBiEntity· 42 fields from this tableMainAccountCDREntity· 39 fields from this tableMainAccountCompanyEntity· 2 fields from this tableLedgerConsolidateAccountGroupV2Entity· 3 fields from this tableCPParametersEntity· 8 fields from this tableCPRediscountTableEntity· 8 fields from this tableELDimensionMainAccountEntity· 2 fields from this tableISRConceptEntity· 2 fields from this tableLedgerAllocationEntity· 3 fields from this tableLedgerBalanceControlEntity· 3 fields from this tableLedgerBalanceSheetDefinitionEntity· 2 fields from this tableLedgerConsolidateAccountGroupEntity· 2 fields from this tableLedgerLiquidityDependencyEntity· 2 fields from this tableLedgerLiquidityEntity· 2 fields from this tableLedgerMatrixAccountReportSetupEntity· 2 fields from this tableLedgerOpeningSheetEntity· 3 fields from this tableLedgerStatementDefinitionEntity· 1 field from this tableLedgerTransSettlementAccountEntity· 1 field from this tableMainAccountLegalEntityOverrideEntity· 3 fields from this tableMainAccountTotalAccountIntervalEntity· 1 field from this tableMainAccountTranslationEntity· 4 fields from this tableRTax25LedgerIntervalEntity· 2 fields from this tableTaxReport347AccountEntity· 2 fields from this tableEDInvoiceTableEntity· 2 fields from this table
Need help with MainAccount in a report, an integration or a migration? Talk to Dr Dynamics.