
Dear Experts
I have custom dimension "Location" for city names how can i get values entered for that dimension to show in Look Up, which table/Method i have to mention in look up parameter I am new in X++
Thanks & Regards
Afridi
*This post is locked for comments
I have the same question (0)Hi Afridi,
The financial dimension framework is quite difficult to understand. You can use the next coding for a dimension lookup.
You can create a lookup method on the form object itself. Fill the dimensionName variable with your "location" dimension name. Note that this code is copied from a class. On form level you probably have to adjust parameters.
protected static client void lookupDimension(FormStringControl _stringControl, Name _dimensionName)
{
Args e;
FormRun lookupFormRun;
DimensionAttribute dimAttr;
if (_stringControl != null)
{
// Construct arguments for the custom lookup
e = new Args();
e.name(formStr(DimensionDefaultingLookup));
e.lookupValue(_stringControl.text());
e.caller(_stringControl);
// Find the dimension attribute associated with the string control which called this method
dimAttr = DimensionAttribute::findByName(_dimensionName);
e.lookupField(dimAttr.ValueAttribute);
e.record(dimAttr);
// Run the custom lookup and init the lookup form
lookupFormRun = classfactory.formRunClass(e);
lookupFormRun.init();
_stringControl.performFormLookup(lookupFormRun);
}
}