Adding two new fields on the InventOnHandItem form :
- Add two controls in the grid dimension and supplier.
- On the InventSum datasource add 2 new display methods to display data in these fields on the form.
Display method for dimension :
Display public AttributeValueText displayDimension(Inventsum _inventSum)
{
PdmProduct pdmProduct;
PdmProductItem pdmProductItem;
PdmProductItemAttribute pdmProductItemAttribute;
EcoResProduct ecoResProduct;
AttributeValueText returnValue;
EcoResValue ecoResValue;
EcoResAttribute ecoResAttribute;
ecoResProduct = EcoResProduct::findByDisplayProductNumber(_inventSum.ItemId);
select Attribute,Value from pdmProductItemAttribute
join pdmProductItem
where pdmProductItem.RecId == PdmProductItemAttribute.ProductItem
join pdmProduct
where pdmProduct.RecId == pdmProductItem.ProductRecId
&& pdmProduct.EcoResProduct == ecoResProduct.RecId
join ecoResAttribute
where ecoResAttribute.RecId == pdmProductItemAttribute.Attribute
&& ecoResAttribute.Name == "Dimension";
{
ecoResValue = EcoResValue::find(pdmProductItemAttribute.Value);
returnValue = ecoResValue.value();
}
return returnValue;
}
Display method for Supplier :
Display public AttributeValueText displaySupplier(Inventsum _inventSum)
{
PdmProduct pdmProduct;
PdmProductItem pdmProductItem;
PdmProductItemAttribute pdmProductItemAttribute;
EcoResProduct ecoResProduct;
AttributeValueText returnValue;
EcoResValue ecoResValue;
EcoResAttribute ecoResAttribute;
ecoResProduct = EcoResProduct::findByDisplayProductNumber(_inventSum.ItemId);
select Attribute,Value from pdmProductItemAttribute
join pdmProductItem
where pdmProductItem.RecId == PdmProductItemAttribute.ProductItem
join pdmProduct
where pdmProduct.RecId == pdmProductItem.ProductRecId
&& pdmProduct.EcoResProduct == ecoResProduct.RecId
join ecoResAttribute
where ecoResAttribute.RecId == pdmProductItemAttribute.Attribute
&& ecoResAttribute.Name == "Supplier";
{
ecoResValue = EcoResValue::find(pdmProductItemAttribute.Value);
returnValue = ecoResValue.value();
}
return returnValue;
}
4. Now on the newly added form control --> dimension --> in the properties window -->
datasource -- InventSum
datamethod -- displayDimension
5. supplier -->
datasource -- InventSum
datamethod -- displaySupplier