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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Customise the lookup of default dimension values

(0) ShareShare
ReportReport
Posted on by 2,699

Hi,

Does anyone happen to know the exact form or class to customise the output of a lookup on a default dimension?

I have added a custom field to the DimensionAttributeValue table and I now want to use this field as a range value in whatever query is used to retrieve all dimension values for a particular dimension.

So far I've been examining the SysLookup class and method lookupDimension - it appears to point towards the form DimensionDefaultingLookup but within this form I am struggling to find where I can edit the query range as it doesn't reference the DimensionAttributeValue table.

All help greatly appreciated.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Maciej Obojski Profile Picture
    610 on at
    RE: Customise the lookup of default dimension values

    Hi Kauto,

    looking into my application (standard AX 2012 R3 demo), I can see below code in the closeSelect method of 'DimensionDefaultingLookup form.

    The code, as you will see (for Russian functionality at least) will look for the DimensionAttributeValue record, which represents selected dimension:

    public void closeSelect(str _selectString)

    {

       DimensionAttributeValue     dimAttrValue;

       boolean                     valueFound;

       // <GEERU>

       if(!canSelect)

       {

           return;

       }

       // </GEERU>

       super(_selectString);

       // Pass the currently selected value and recid back to the controller if it exists

       if (controller != null)

       {

           valueFound = false;

           if (strLen(_selectString) > 0)

           {

               // Get the associated dimension attribute value

               changecompany (dimAttr.company())

               {

                   // <GEERU>

                   dimAttrValue = DimensionAttributeValue::findByDimensionAttributeAndEntityInst(dimAttr.RecId, ds.(dimAttrViewContract.parmKeyFieldId()), false, true);

                   // </GEERU>

               }

               if (dimAttrValue)

               {

                   controller.setDimensionAttributeValue(dimAttr, dimAttrValue.RecId, _selectString);

                   valueFound = true;

               }

           }

           if (!valueFound)

           {

               // No value was selected, clear out the existing value

               controller.setDimensionAttributeValue(dimAttr, 0, '');

           }

       }

    }

    You could potentially try using the logic inside the 'findByDimensionAttributeAndEntityInst' method, but there is a point to consider: there might not exist records in DimensionAttributeValue  table at the time of performing lookup.

    Let me know if this helped you by any means,

    Maciej

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Willem van Duren Profile Picture

Willem van Duren 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans