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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Filter dimensions lookup on a segmented entry control

(0) ShareShare
ReportReport
Posted on by 1,215

Hi,

A custom field was added on the DIMENSIONATTRVALUELEDGEROVERRIDE table.

To display this field on the segmented entry control of "General journals > Lines" a view was created with following tables:

DIMENSIONFINANCIALTAG 
DIMENSIONATTRIBUTEDIRCATEGORY 
DIMENSIONATTRIBUTE 
DIMENSIONATTRIBUTEVALUE 
DIMENSIONATTRVALUELEDGEROVERRIDE

and in the following event handler:

[PostHandlerFor(tableStr(DimensionAttribute), tableStaticMethodStr(DimensionAttribute, getViewContract))]

the following parameters were provided:

parmViewName
parmViewId
parmCategoryField
parmNameFieldId
parmKeyFieldId
parmValueFieldId

But now, the segmented entry shows dimensions from all the data area ids.

How to restrict it for the current data area id only?

Note: when I comment the parameters in the event handler created, the dimensions are filtered based on the current company, so 

something is definitely missing in the filter criteria.

Regards,

Abhinay

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,030 Super User 2025 Season 2 on at

    Hi Abhinay,

    Can you explain what you tried to achieve? Have a new field on a certain table or have a new dimension set up? What is this customization about? Can you probably illustrate it with screenshots?

  • Abhinay Tharwal Profile Picture
    1,215 on at

    Hi André,

    On the DIMENSIONATTRVALUELEDGEROVERRIDE table a new string field was added.

    And in the segmented entry control of the dimensions, the newly added string field was to be shown.

    This was the requirement.

    Regards,

    Abhinay

  • Sumit Loya Profile Picture
    2,230 on at

    Hi Abhinay,

    The requirement isn't clear. The Segmented Entry Control is to display the financial dimensions active for a company. Why would you want to display a custom field on this control? What was the need to add this custom field on DimensionAttrValueLedgerOverride what is the use of this field?  What are you trying to achieve holistically here?

  • Abhinay Tharwal Profile Picture
    1,215 on at

    Hi Sumit,

    [quote user="Sumit Loya"]Why would you want to display a custom field on this control? What was the need to add this custom field on DimensionAttrValueLedgerOverride what is the use of this field?[/quote]

    As I said earlier, it is just a string field, let us call it a description field. It was added to the table "DimensionAttrValueLedgerOverride" so that is could store that description per data area id at "Financial dimensions > "dimension values" button > "legal entities override" section.

    Regards,

    Abhinay

  • Abhinay Tharwal Profile Picture
    1,215 on at

    Hi,

    I have found a method "getAutoCompleteDataFromDatabase" in the "LedgerDimensionController" abstract class.

    Here the newly created view gets filtered.

    /// 
    /// The LedgerDimensionController class provides base support for multi segment data entry in the segmented entry control.
    /// 
    /// This is a framework class. Customizing this class may cause problems with future upgrades to the software.
    public abstract class LedgerDimensionController extends DimensionController implements DimensionMultiSegmentController

    /// 
        /// Retrieves the appropriate auto complete data from the database.
        /// 
        /// 
        /// The collection to which the lookup data should be added.
        /// 
        /// 
        /// The AutoCompletDataMode data type specifies type of auto complete data to load.
        /// 
        /// 
        /// The ID of the DimensionAttribute record to get auto complete data for.
        /// 
        /// 
        /// The last value paged into the result set.
        /// 
        /// 
        /// The index of the segment to get auto complete data for.
        /// 
        /// 
        /// The company that the controller was called from before any calls to change company.
        /// 
        /// 
        /// The number of records paged.
        /// 
        protected int getAutoCompleteDataFromDatabase(
            Array                           _elements,
            AutoCompleteDataMode            _autoCompleteMode,
            str                             _filterValue,
            DimensionAttributeRecId         _dimensionAttributeId,
            str                             _lastPagedValue,
            int                             _segmentIndex,
            DataAreaId                      _originalCompany)

  • André Arnaud de Calavon Profile Picture
    301,030 Super User 2025 Season 2 on at

    Hi Abhinay,

    You have to be more clear on the requirement. Just mentioning 'string' and 'segmented entry control' is not a functional business requirement. I'm not able to understand the requirement now, so also don't know if you are trying to do something that could be a configuration in the end.

    Please take some time to explain more details, so we are able to guide you. Can you share a mock-up of the required end result?

  • Abhinay Tharwal Profile Picture
    1,215 on at

    Hi André,

    I'm sorry I was not able to explain the requirement properly. Let me try again.

    [quoteCan you share a mock-up of the required end result? [/quote

    I am not at the liberty to do so, else I would have shared the code/ screens.

    If you could go to the General ledger > Chart of accounts > Dimensions > Financial dimensions form

    then click the button "Dimension values", Dimension details form would open.

    In the lower right hand side corner, there is a grid on tab page "Legal entity overrides".

    A string field was added to the table "DimensionAttrValueLedgerOverride" and will be editable in the grid I mention in the line above.

    Now, to make this newly added field visible on the dimension lookup fields like General ledger > Journal entries > General journals

    add a journal, then go to Lines and add a line in the "Accounts" field column which is a segmented entry control, click drop down

    on this lookup form (DimensionLookup) two columns are in the grid "Value" and "Description".

    This "Description" column was to be replaced with this newly created column. So a view was created with tables:

    DIMENSIONFINANCIALTAG 
    DIMENSIONATTRIBUTEDIRCATEGORY 
    DIMENSIONATTRIBUTE 
    DIMENSIONATTRIBUTEVALUE 
    DIMENSIONATTRVALUELEDGEROVERRIDE

    as mentioned in my original post.

    Regards,

    Abhinay

  • Pedro Tornich Profile Picture
    955 on at

    Hi Abhinay,

    For what I see, you don't want to change the segmented entry itself, but only the information shown in the lookup that is produced for a specific dimension.

    I see you were able to change the data source and the fields on the lookup by using that event handler you mentioned, and now the only problem is that your lookup is not filtering by the current company anymore.

    Your problem is that none of the tables you used in your view has the "SaveDataPerCompany" property enabled. In other words, D365 cannot filter by company because the tables you are using don't keep data per company, they don't even have the DataAreaId column if you look at them in SQL.

  • Sumit Loya Profile Picture
    2,230 on at

    Hi Abhinay,

    Looks like you want to display the custom field in DimensionLookup form. Few things here. The legal entity overrides table stores overrides for each company. So there will be many records for each DimensionAttributeValue record. Also from your description, I see that you created a view using DimensionFinancialTag table which stores values only for financial dimensions that are created using Custom list option while creating financial dimension. So if you don't have this custom field applicable to a financial dimension created using Existing list (Ex: Business unit, Customer etc.) then this is fine, otherwise your view will not fetch the data.

    Coming to changes to DimensionLookup form, I remember you said that you were able to add the view to lookup but it showed data for all companies. That is because DimensionAttributeValueLedgerOverride contains data for all companies. But it also has a field for LegalEntity. So what you can do is to add a filter range for current company on this table / view you created. This should limit the values only to current company.

    I hope this helps you in resolving the issue. Let us know how this goes.

  • Abhinay Tharwal Profile Picture
    1,215 on at

    Hi Pedro,

    Thank you for your reply!

    [quote user="Pedro Tornich"] Your problem is that none of the tables you used in your view has the "SaveDataPerCompany" property enabled[/quote]

    That is correct. I am trying to figure out a way to filter the lookup now. I can use the joins with Ledger table and the CompanyInfo table to restrict the data.

    Regards,

    Abhinay

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans