1. Add a new form level variable of type LanguageId, called custLanguageId.
2. Add a method on the data source InventDimDimension called custProductName() with the below code:
public display EcoResProductName custProductName(InventDim _inventDimDimension)
{
FieldId dimFieldId = element.inventDimSetupObject().parmMainSortFieldId();
ItemId callerItemId = element.inventDimSetupObject().callerItemId();
return EcoResProductMasterDimValueTranslation::findByProductMasterDimValLanguage(
EcoResProductMasterSize::find(InventTable::find(callerItemId).product, EcoResSize::findByName(_inventDimDimension.(dimFieldId)).RecId).RecId,
custLanguageId).name;
}
3. Drag the method over to the grid GridDimension on the first tab page, and make sure to set the datasource on the control to InventDimDimension
4. In the init method on the form, add the following code:
FormDataSource lineDS;
SalesLine salesLine;
...
lineDS = callerControl.dataSourceObject().joinSourceDataSource();
if (lineDS.table() == TableNum(SalesLine))
{
salesLine = lineDS.cursor();
//custLanguageId = CustTable::find(salesLine.CustAccount).languageId();
custLanguageId = salesLine.salesTable().LanguageId;
}
That should do it.
You would of course need to "beautify" this code, and make sure it shows up when it needs to and not at other times (I gave an example above with checking for the table being SalesLine, but you could also check based on the field, the item, the form calling the lookup, etc.)