Hi Guy's I want to Get ConstCenter(Dimension ) in PO Report my code is
private str 255 getDeprtmentDim( PurchId _purchid)
//private PurchId getDeprtmentDim( )
{
//PurchId _purchid;
PurchTable PurchTable;
PurchLine PurchLine;
DimensionAttributeValueSet dimAttrValueSet;
DimensionAttributeValueSetItem dimAttrValueSetItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttr;
Common dimensionValueEntity;
;
// Find our supplier
// PurchLine = PurchLine::find('PO-00078');
PurchTable= PurchTable::find(_purchid);
// Find the dimension value set that the vendor points to (for specifying the
// 'default' dimensions). This table is used as a sort of 'header' that the
// value set items (DimensionAttributeValueSetItem) records belong to.
//dimAttrValueSet = DimensionAttributeValueSet::find(PurchLine.DefaultDimension);
dimAttrValueSet = DimensionAttributeValueSet::find(PurchTable.DefaultDimension);
// Find all of the 'value set items' linked against the 'value set'
while select dimAttrValueSetItem
where dimAttrValueSetItem.DimensionAttributeValueSet == dimAttrValueSet.RecId
{
// Find the dimension 'value' (DimensionAttributeValue) that the set item points to.
dimAttrValue = DimensionAttributeValue::find(dimAttrValueSetItem.DimensionAttributeValue);
// Find the underlying attribute.
dimAttr = DimensionAttribute::find(dimAttrValue.DimensionAttribute);
// Use the helper class to obtain a reference to the underlying entity (can be anything)
dimensionValueEntity = DimensionDefaultingControllerBase::findBackingEntityInstance(
curext(),
dimAttr,
dimAttrValue.EntityInstance);
//info(dimAttr.Name + ' ' + dimAttrValue.getValue());
If(dimAttr.Name=='Department')
{
return dimAttrValue.getValue();
}
}
return '';
}
if this code is fine then how to insert in PurchPurchaseOrderHeader Table and i also add field in
PurchPurchaseOrderHeader table
please help me
Thanks