其实在InventSize上定义titlefield1和tilefield2是没有问题的,关键是InventDim上的方法tooltipfield改变了显示的内容而已,只要在这里修改一下,就可以达到目的了。
当某个Inventdim在Form中选择父数据源有字段为ItemId的时候,该窗体栏顶端总是显示Item number信息.
public str toolTipField(fieldId _fieldId)
{
str ret;
FormDataSource formDataSource;
formDatasource formDatasourceJoined;
fieldId fieldId;
ItemId itemId;
{
str ret;
FormDataSource formDataSource;
formDatasource formDatasourceJoined;
fieldId fieldId;
ItemId itemId;
ret = super(_fieldId);
switch(_fieldId)
{
case fieldNum(InventDim, configId):
case fieldNum(InventDim, inventSizeId):
case fieldNum(InventDim, inventColorId):
case fieldNum(InventDim, inventBatchId):
formDataSource = this.dataSource();
if (formDataSource && formDataSource.table() == tableNum(InventDim))
{
formDatasourceJoined = formGetParentDatasource(formDataSource);
if (formDatasourceJoined)
{
fieldId = fieldName2Id(formDatasourceJoined.table(),fieldstr(InventTable,itemId));
if (fieldId)
{
itemId = formDatasourceJoined.cursor().(fieldId);
if (itemId)
{
ret = strfmt("@SYP183", itemId, this.(_fieldId));
return ret;
}
}
}
}
return strfmt("%1", this.(_fieldId));
}
{
case fieldNum(InventDim, configId):
case fieldNum(InventDim, inventSizeId):
case fieldNum(InventDim, inventColorId):
case fieldNum(InventDim, inventBatchId):
formDataSource = this.dataSource();
if (formDataSource && formDataSource.table() == tableNum(InventDim))
{
formDatasourceJoined = formGetParentDatasource(formDataSource);
if (formDatasourceJoined)
{
fieldId = fieldName2Id(formDatasourceJoined.table(),fieldstr(InventTable,itemId));
if (fieldId)
{
itemId = formDatasourceJoined.cursor().(fieldId);
if (itemId)
{
ret = strfmt("@SYP183", itemId, this.(_fieldId));
return ret;
}
}
}
}
return strfmt("%1", this.(_fieldId));
}
return ret;
}
}
没有评论:
发表评论