Hi OR-12050748-0,
1) Issue
In D365 Finance, a custom restriction for a Financial Dimension (e.g., "Office") has been implemented successfully using:
- DimensionCombinationEntity.dimensionCombinationDimensionSegmentCustomLookup()
- A custom subclass of DimensionSegmentLookupGeneratorBase
This works correctly in Excel Add-in for:
- LedgerJournalLineEntity (based on LedgerJournalTrans)
However, the same restriction does not trigger for:
- BudgetRegisterEntryEntity (based on BudgetTransactionLine)
Observed behavior:
- In Excel Add-in, when selecting the Financial Dimension “Office”:
- For LedgerJournalLineEntity → custom lookup is triggered
- For BudgetRegisterEntryEntity → custom lookup is not triggered
- Debugger never enters:
DimensionCombinationEntity.dimensionCombinationDimensionSegmentCustomLookup()
2) Reason
The root cause is probably not the entity itself, but the Extended Data Type (EDT) and metadata binding used for the financial dimension field.
Key difference:
A) LedgerJournalTrans (working scenario)
- Field: LedgerDimension
- EDT: DimensionDynamicAccount
- Includes:
- Account structure awareness
- Support for dynamic dimension segment resolution
- OData action binding to:
DimensionCombinationEntityDimensionSegmentCustomLookup
This triggers the Excel Add-in lookup extensibility
B) BudgetTransactionLine (non-working scenario)
- Field: LedgerDimension
- EDT: LedgerDimensionBudget
- Inheritance:
- DimensionCombinationBase
→ LedgerDimensionBase
→ LedgerDimensionBudget
This EDT:
- Does not expose the same lookup metadata
- Does not bind to the OData action:
dimensionCombinationDimensionSegmentCustomLookup
Result:
- Excel Add-in uses a different lookup mechanism
- Your custom lookup extension is never triggered
C) Why adding fields didn’t work
Adding:
- LedgerDimension (DimensionDynamicAccount EDT)
- AccountType to BudgetTransactionLine does not fix the issue because:
- Excel Add-in metadata is driven by:
- The data entity field mapping
- The exposed EDT on the entity field (not just table structure)
- BudgetRegisterEntryEntity still:
- Uses LedgerDimensionBudget
- Therefore does not expose the custom OData action
D) Core limitation
The method:
DimensionCombinationEntity.dimensionCombinationDimensionSegmentCustomLookup()
is only invoked when:
- The field is based on:
DimensionDynamicAccount EDT
- and the entity metadata exposes the OData action
Budget entities are designed differently and do not use this mechanism.
3) Resolution
Option 1: Extend the Data Entity (recommended)
Modify BudgetRegisterEntryEntity:
- Add a new field using:
DimensionDynamicAccount EDT
- Map this field to:
BudgetTransactionLine.LedgerDimension
- Ensure:
- The new field is exposed in OData
- The Excel Add-in uses this field instead of the original one
This allows:
- Excel to detect the OData action
- Custom lookup to be triggered
Option 2: Replace field binding in Excel Add-in
- Remove usage of:
Original LedgerDimension field
- Use:
Newly introduced DimensionDynamicAccount-based field
This aligns behavior with LedgerJournalLineEntity
Option 3: Custom OData action exposure (advanced)
- Extend BudgetRegisterEntryEntity
- Explicitly expose:
DimensionCombinationEntityDimensionSegmentCustomLookup
This requires:
- Custom service behavior
- Advanced extension of entity metadata
Option 4: Custom lookup workaround
If EDT replacement is not feasible:
- Implement a custom lookup restriction:
- At form/data source level (less ideal for Excel)
- Or via validation logic
Note:
- This will not affect Excel Add-in lookup behavior directly
---
Important limitations
- LedgerDimensionBudget EDT does not support:
- Dynamic account-based lookup extensibility
- Excel Add-in relies strictly on:
- OData metadata + EDT behavior
- You cannot “force” the existing method to trigger without changing the EDT context
---
Summary
The issue is probably caused by the difference in EDTs:
- DimensionDynamicAccount → supports custom lookup via OData action
- LedgerDimensionBudget → does not support it
because BudgetRegisterEntryEntity uses LedgerDimensionBudget, the custom lookup method is never triggered.
To resolve this, you probably must:
- Introduce a DimensionDynamicAccount-based field in the entity
- Ensure Excel Add-in uses that field
This is a framework limitation rather than a bug.
---
*Used Objects can differ or be used as example in this answer given
---
For a more detailed answer, please provide more information.
Rg,
Alexander
*Due to the complex and different possibilities of deploying Dynamics 365 I highly recommend not to setup the application without some expert/partner or support. (For more information contact me under anassl@inno-solutions.info or visit www.inno-solutions.de)
*The Information comes directly from the manufacturer or provider and are validated (not guaranteed) up to date of creation of the posting.
References:
- Microsoft Licensing Guide
- Microsoft Doc`s/Learn