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 descriptionType / EDT / enumMandatoryReferencesIn public entities
MainAccountIdMain account number, part of the key.String (20)
MainAccountNum
YesMainAccountEntityMainAccountEntityMainAccountEntityand 37 more
LedgerChartOfAccountsPoints to the chart of accounts that the account belongs to.Int64
RefRecId
YesLedgerChartOfAccounts.RecIdMainAccountEntityDimAttributeMainAccountEntityMainAccountBiEntityand 17 more
AccountCategoryRefPoints to the main account category of the account.Integer
AccountCategoryRef
NoMainAccountCategory.AccountCategoryRefMainAccountEntityMainAccountBiEntityMainAccountCDREntity
AdjustmentMethod_MXAdjustment method for the account, such as transaction date or monthly balance. Used for Mexico.Enum
AdjustmentMethod_MX (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
CloseTypeClose type of the account: not applicable, real, nominal or nominal with no close.Enum
AccountCloseType (enum)
NoMainAccountBiEntityMainAccountCDREntity
ClosingClosing choice for the account: none, result, balance or capital.Enum
LedgerClosing (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
ConsolidationMainAccountDefault main account used for consolidation, as text.String (20)
LedgerConsolidateMainAccount
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
CreatedByThe user who created the record. System field.String (20)
CreatedBy
NoMainAccountBiEntity
CreatedDateTimeThe date and time when the record was created. System field.UtcDateTime
CreatedDateTime
NoMainAccountBiEntityMainAccountCDREntity
CurrencyCodeCurrency code linked to the account.String (3)
CurrencyCode
NoCurrency.CurrencyCodeMainAccountEntityMainAccountBiEntityMainAccountCDREntity
DebitCreditBalanceDemandBalance control choice: none, debit or credit.Enum
DebCredBalanceDemand
DebCredProposal (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
DebitCreditCheckDebit or credit requirement for the account: none, debit or credit.Enum
DebCredProposal (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
DebitCreditProposalDebit or credit side suggested for the account: none, debit or credit.Enum
DebCredProposal (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
ExchangeAdjustedYes/no flag for foreign currency revaluation of the account.Enum
NoYes (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
ExchangeAdjustmentRateTypePoints to the exchange rate type used for adjustment.Int64
ExchangeRateTypeRecId
NoExchangeRateType.RecIdMainAccountEntityMainAccountBiEntityMainAccountCDREntity
FinancialReportingExchangeRateTypePoints to the exchange rate type used for financial reporting.Int64
ExchangeRateTypeRecId
NoExchangeRateType.RecIdMainAccountEntityMainAccountBiEntityMainAccountCDREntity
FinancialReportingTranslationTypeCurrency translation type for reporting: weighted average, average, current or transaction date.Enum
FinancialReportingTranslationType (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
InflationAdjustment_MXYes/no flag for the B-10 inflation adjustment. Used for Mexico.Enum
InflationAdjustment_MX
NoYes (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
MainAccountTemplatePoints to the main account template linked to the account.Int64
RefRecId
NoMainAccountTemplate.RecIdMainAccountBiEntityMainAccountCDREntity
MandatoryPaymentReferenceYes/no flag that shows whether a payment reference is mandatory.Enum
NoYes (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
ModifiedByThe user who last changed the record. System field.String (20)
ModifiedBy
NoMainAccountBiEntity
ModifiedDateTimeThe date and time when the record was last changed. System field.UtcDateTime
ModifiedDateTime
NoMainAccountBiEntityMainAccountCDREntity
MonetaryYes/no flag that shows whether the account is monetary.Enum
LedgerMonetary
NoYes (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
NameName of the main account.String (60)
AccountName
YesMainAccountEntityDimAttributeMainAccountEntityMainAccountBiEntityand 7 more
NatureCode_BRTwo-character nature code of the account. Used for Brazil.String (2)
NatureCode_BR
NoMainAccountEntityMainAccountCDREntity
OffsetLedgerDimensionPoints to a dimension code combination used as the offset account.Int64
LedgerDimensionDefaultAccount
NoDimensionAttributeValueCombination.RecIdMainAccountEntityMainAccountBiEntityMainAccountCDREntity
OpeningAccountPoints to another main account used as the opening account.Int64
MainAccountRecId
NoMainAccount.RecIdMainAccountBiEntityMainAccountCDREntity
ParentMainAccountPoints to the parent main account.Int64
MainAccountRecId
NoMainAccount.RecIdMainAccountBiEntityMainAccountCDREntity
ParentMainAccount_BRReference to the parent account. Used for Brazil.Int64
RefRecId
NoNone
PartitionA system field for the data partition. In most environments every record has the same value. System field.Int64
Partition
NoNone
PostingTypePosting type assigned to the account, such as exchange rate gain, sales tax or allocation.Enum
LedgerPostingType (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
RecIdA unique number that the system gives to every record. Other tables often use it to point to this record. System field.Int64
RecId
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntityand 3 more
RecVersionA system number that changes each time the record is updated. It is used to detect conflicting updates. System field.Integer
RecVersion
NoMainAccountBiEntity
RepomoType_MXREPOMO type: not applicable, asset or liability. Used for Mexico.Enum
RepomoType_MX (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
ReportingAccountTypeReporting type of the account, such as none, header, empty header or page header.Enum
DimensionLedgerAccountReportingType (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
ReportingExchangeAdjustmentRateTypePoints to the exchange rate type for adjusting in the reporting currency.Int64
ExchangeRateTypeRecId
NoExchangeRateType.RecIdMainAccountEntityMainAccountBiEntityMainAccountCDREntity
SRUCodeSRU code of the account (up to 4 characters).String (4)
LedgerSRUCode
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
StandardMainAccount_WPoints to the standard general ledger account.Int64
RefRecId
NoStandardMainAccount_W.RecIdMainAccountBiEntityMainAccountCDREntity
SysRowVersionA system row version number that is used for change tracking. System field.Int64
SysRowVersion
NoNone
TableIdA system number that identifies the table. System field.Integer
TableId
NoNone
TransferYearEndAccount_ESPoints to the main account used for transferring the year-end result. Used for Spain.Int64
MainAccountRecId
NoMainAccount.RecIdMainAccountBiEntityMainAccountCDREntity
TypeMain account type, such as profit and loss, revenue, expense, balance sheet or asset.Enum
DimensionLedgerAccountType (enum)
NoMainAccountEntityDimAttributeMainAccountEntityMainAccountBiEntityand 2 more
UnitOfMeasurePoints to the unit of measure linked to the account.Int64
UnitOfMeasureRecId
NoUnitOfMeasure.RecIdMainAccountBiEntityMainAccountCDREntity
UserInfoIdUser ID linked to the account.low confidenceString
UserId
NoMainAccountEntityMainAccountBiEntity
ValidateCurrencyRule for the currency code: optional, required, or limited to one or several valid options.Enum
FieldControl (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
ValidatePostingRule for validating posting: optional, required, or limited to one or several valid options.Enum
FieldControl (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity
ValidateUserRule for the user: optional, required, or limited to one or several valid options.Enum
FieldControl (enum)
NoMainAccountEntityMainAccountBiEntityMainAccountCDREntity

Indexes (5)

Relations (14)

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

  • Currency → Currency

    Join on CurrencyCode = Currency.CurrencyCode

    Many MainAccount records → zero or one Currency record

  • FinancialReportingExchangeRateType → ExchangeRateType

    Join on FinancialReportingExchangeRateType = ExchangeRateType.RecId

    Many MainAccount records → zero or one ExchangeRateType record

  • LedgerChartOfAccounts → LedgerChartOfAccounts

    Join on LedgerChartOfAccounts = LedgerChartOfAccounts.RecId

    Many MainAccount records → exactly one LedgerChartOfAccounts record

  • MainAccountCategory → MainAccountCategory

    Join on AccountCategoryRef = MainAccountCategory.AccountCategoryRef

    Many MainAccount records → zero or one MainAccountCategory record

  • OffsetLedgerDimension → DimensionAttributeValueCombination

    Join on OffsetLedgerDimension = DimensionAttributeValueCombination.RecId

    Many MainAccount records → zero or one DimensionAttributeValueCombination record

  • OpeningAccount → MainAccount

    Join on OpeningAccount = MainAccount.RecId

    Many MainAccount records → zero or one MainAccount record

  • ParentMainAccount → MainAccount

    Join on ParentMainAccount = MainAccount.RecId

    Many MainAccount records → zero or one MainAccount record

  • TransferYearEndAccount_ES → MainAccount

    Join on TransferYearEndAccount_ES = MainAccount.RecId

    Many MainAccount records → zero or one MainAccount record

  • UnitOfMeasure → UnitOfMeasure

    Join on UnitOfMeasure = UnitOfMeasure.RecId

    Many MainAccount records → zero or one UnitOfMeasure record

  • UserInfo → UserInfo

    Join on UserInfoId = UserInfo.id

    Many MainAccount records → zero or one UserInfo record

  • ExchangeAdjustmentRateType → ExchangeRateType

    Join on ExchangeAdjustmentRateType = ExchangeRateType.RecId

    Many MainAccount records → zero or one ExchangeRateType record

  • ReportingExchangeAdjustmentRateType → ExchangeRateType

    Join on ReportingExchangeAdjustmentRateType = ExchangeRateType.RecId

    Many MainAccount records → zero or one ExchangeRateType record

  • MainAccountTemplate → MainAccountTemplate

    Join on MainAccountTemplate = MainAccountTemplate.RecId

    Many MainAccount records → zero or one MainAccountTemplate record

  • StandardMainAccount_W → StandardMainAccount_W

    Join on StandardMainAccount_W = StandardMainAccount_W.RecId

    Many 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.

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

Email sales@drdynamics.co.uk