Tuesday, 16 July 2013

job for dimension for hcm worker

static void irfDimension(Args _args)
{
 HcmWorker HcmWorker;
 int64 HcmDim;
 DocuRef DocuRef;
 //purchTable purchTable;
 DimensionAttributeValueSetStorage dimStorage;
 Counter i;
 DimensionAttributeValueSet dimAttrValueSet;
 DimensionAttributeValueSetItem dimAttrValueSetItem;
 DimensionAttributeValue dimAttrValue;
 DimensionAttribute dimAttr;
 Common dimensionValueEntity;
 //VendPurchOrderJour VendPurchOrderJour;
 //int64 PurchRecid,PurchDim,TableId;
 //PurchIdBase purchID;
 str st,c,d;
// PurchPurchaseOrderHeader PurchPurchaseOrderHeader;
    // while select HcmWorker{
 // if(purchTable.PurchId == VendPurchOrderJourloc.PurchaseOrderId)
// purchID = VendPurchOrderJour::findbyPurchaseOrderId(PurchPurchaseOrderHeader.PurchaseOrderId).PurchId;
select HcmWorker where HcmWorker.PersonnelNumber == “00043″;
    HcmDim = HcmWorker::find(HcmWorker.RecId).DefaultDimension;
    dimAttrValueSet = DimensionAttributeValueSet::find(HcmDim);
 // Find all of the ‘value set items’ linked against the ‘value set’
 while select dimAttrValueSetItem wheredimAttrValueSetItem.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);
 if(dimAttr.Name == “Branch”)
 {
 //PurchPurchaseOrderHeader.Dim = dimAttr.Name;
     st = dimAttr.Name;
 //PurchPurchaseOrderHeader.DimValue1 = dimAttrValue.getValue();
     c = dimAttrValue.getValue();
    d = dimAttrValue.getName();
 }
 //info(dimAttr.Name + ‘ ‘ + dimAttrValue.getValue());
 }
 //}
 //purchPurchaseOrderHeader.insert();
// print PurchPurchaseOrderHeader.Dim;
// print PurchPurchaseOrderHeader.DimValue1;
     print st;
    print c;
    print d; 
  pause;
 }
 //}


No comments:

Post a Comment