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
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,104 Most Valuable Professional
nmaenpaa 101,156