web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Excel add-in. Field lookup filtration doesn’t work consistently

(3) ShareShare
ReportReport
Posted on by 8
I need to restrict values for certain field (one of Financial Dimensions) in Excel add-in.

There is a well known approach (https://community.dynamics.com/blogs/post/?postid=c3176cf6-231d-42d8-a6a7-fbf2f33e4c2f ), which allows to separate Financial Dimensions in Excel add-in, and I successfully implemented such approach for the two DataEntities (LedgerJournalLineEntity and BudgetRegisterEntryEntity – I’ve created an extension in MyModel (MYM)).
Apart from that I got a requirement to restrict values in the lookup for one of FinancialDimensions (when you open the Excel add-in and focus on FinancialDimension field (let’s say – Office) you should be able to see (on the right side) the list of available Offices I need to restrict values for certain field (one of Financial Dimensions) in Excel add-in.
 
There is a method (DimensionCombinationEntity.dimensionCombinationDimensionSegmentCustomLookup()) – which allows to do that.

Here is the signature of that method:
[SysODataActionAttribute("DimensionCombinationEntityDimensionSegmentCustomLookup", false),
 SysODataCollectionAttribute("_fields", Types::String)]
public static str dimensionCombinationDimensionSegmentCustomLookup(Array _fields)

You can create a subclass of DimensionSegmentLookupGeneratorBase and apply a restriction for any Financial Dimension (I did it for Office) — and this also works. Pay attention to the method's attributes: SysODataActionAttribute.
It is logical to assume that if there is some other entity (say not LedgerJournalLineEntity but BudgetRegisterEntryEntity) which also has a relation with DimensionCombinationEntity (BudgetRegisterEntryEntity.Dimension == DimensionCombinationEntity.RecId), then our restriction for Office should also trigger?! But it turns out — NO, when in the Excel Add-in we try to select available values for Office in the lookup (exactly the same way we tried for LedgerJournalTrans), the debugger never enters the DimensionCombinationEntity.dimensionCombinationDimensionSegmentCustomLookup() method at all.

It gives the impression that when Excel reads the metadata of LedgerJournalTrans it sees the method DimensionCombinationEntity.dimensionCombinationDimensionSegmentCustomLookup(), but when it reads BudgetRegisterEntryEntity — it does not see the same method.

At the same time we’ve discovered, that field BudgetTransactionLine.LedgerDimension (which is being used in the BudgetRegisterEntryEntity.Dimension – contains the LedgerDimensionBudget EDT)


Whilst LedgerJournalTrans.LedgerDimension (which is being used in the LedgerJournalLineEntity.Account– contains the DimensionDynamicAccount EDT)

Here is the EDTs inheritance structure:
  1. DimensionCombinationBase -> LedgerDimensionBase -> LedgerDimensionBudget (BudgetTransactionLine.LedgerDimension)
  2. DimensionCombinationBase -> LedgerDimensionBase -> LedgerDimensionAccount -> DimensionDynamicAccount (LedgerJournalTrans.LedgerDimension)

We’ve assumed that, that by adding two more fields (LedgerDimension (with DimensionDynamicAccount EDT) and AccountType (with LedgerJournalACType BaseEnum)) to the BudgetTransactionLine table (the same two fields that we have in the LedgerJournalTrans table ) we will achieve the expected result – but we haven’t.


(I’m reminding the purpose of this article: I need to restrict values for the Financial Dimension “Office” in the Excel add-in lookup, i.e. to make sure that when we get focused on the Financial Dimension “Office” field in the Excel add-in lookup the System goes in to the DimensionCombinationEntity.dimensionCombinationDimensionSegmentCustomLookup() method).
 
Categories:
I have the same question (0)
  • Suggested answer
    Assisted by AI
    ANInnoSolutions Profile Picture
    534 on at
    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:

    1. Microsoft Licensing Guide
    2. Microsoft Doc`s/Learn
  • Deepak Agarwal Profile Picture
    9,065 on at
    It might be standard behaviour, as once you opened a entity/form in excel, the CURD operation works kind of offline until you publish them. when you click on publish button at that time Excel add in communicate with D365FO.
  • OR-12050748-0 Profile Picture
    8 on at
    Hi @ANInnoSolutions, thank you for the comment and suggested solution. You wrote:
    To resolve this, you probably must:
    - Introduce a DimensionDynamicAccount-based field in the entity  
    - Ensure Excel Add-in uses that field
     
    I've already tried this, I've added the MYMLedgerDimension field (based on the DimensionDynamicAccount EDT) + I added MYMAccountType field (based on the LedgerJournalACType BE) - such field is used to configure properties on the MYMLedgerDimension field, apart from that I added the same type of relation (please see below) - but it didn't work (during the run time system doesn't trigger the DimensionCombinationEntity.dimensionCombinationDimensionSegmentCustomLookup() method for none of the "MYMLedgerDimension" dimensions)
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 628 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 501 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 437

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans