static void
DEV_Dimension(Args _args)
{
CustTable custTable = CustTable::find(“1101″);
DimensionAttributeValueSetStorage dimStorage;
Counter i;
{
CustTable custTable = CustTable::find(“1101″);
DimensionAttributeValueSetStorage dimStorage;
Counter i;
dimStorage =
DimensionAttributeValueSetStorage::find(5637144576);
//recid of 1101
for (i=1 ; i<= dimStorage.elements() ; i++)
{
info(strFmt(“%1 = %2 = %3 “, DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name,
dimStorage.getDisplayValueByIndex(i),dimStorage.getValueByDimensionAttribute(i)));
}
}
//recid of 1101
for (i=1 ; i<= dimStorage.elements() ; i++)
{
info(strFmt(“%1 = %2 = %3 “, DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name,
dimStorage.getDisplayValueByIndex(i),dimStorage.getValueByDimensionAttribute(i)));
}
}
//////////////////////////////////////////////////
static void Job3(Args
_args)
{
/// <summary>
/// Inserts common data into the template table buffer.
/// </summary>
{
/// <summary>
/// Inserts common data into the template table buffer.
/// </summary>
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;
PurchPurchaseOrderHeader PurchPurchaseOrderHeader;
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;
PurchPurchaseOrderHeader PurchPurchaseOrderHeader;
//
this.initializePurchPurchaseOrderHeader();
/*while select purchTable
{
dimStorage = DimensionAttributeValueSetStorage::find(PurchTable.DefaultDimension);
//PurchPurchaseOrderHeader.DimValue2 = DimensionAttribute::find(dimStorage.getAttributeByIndex(1)).Name;
PurchPurchaseOrderHeader.DimValue1 = dimStorage.getDisplayValueByIndex(1);
PurchPurchaseOrderHeader.Dim = DimensionAttribute::find(dimStorage.getAttributeByIndex(1)).Name;
while select DocuRef where DocuRef.RefRecId == purchTable.RecId && DocuRef.RefCompanyId == purchTable.dataAreaId
&& DocuRef.RefTableId == purchTable.TableId
PurchPurchaseOrderHeader.Notes1 = DocuRef.Notes;
}*/
{
dimStorage = DimensionAttributeValueSetStorage::find(PurchTable.DefaultDimension);
//PurchPurchaseOrderHeader.DimValue2 = DimensionAttribute::find(dimStorage.getAttributeByIndex(1)).Name;
PurchPurchaseOrderHeader.DimValue1 = dimStorage.getDisplayValueByIndex(1);
PurchPurchaseOrderHeader.Dim = DimensionAttribute::find(dimStorage.getAttributeByIndex(1)).Name;
while select DocuRef where DocuRef.RefRecId == purchTable.RecId && DocuRef.RefCompanyId == purchTable.dataAreaId
&& DocuRef.RefTableId == purchTable.TableId
PurchPurchaseOrderHeader.Notes1 = DocuRef.Notes;
}*/
while select PurchTable{
// if(purchTable.PurchId == VendPurchOrderJourloc.PurchaseOrderId)
purchID = VendPurchOrderJour::findbyPurchaseOrderId(PurchPurchaseOrderHeader.PurchaseOrderId).PurchId;
purchID = “000402″;
PurchRecid = purchTable::find(purchID).RecId;
PurchDim = purchTable::find(purchID).DefaultDimension;
TableId = PurchReqLine::findByPurchId(purchID).PurchReqTable;
c = PurchReqTable::find(TableId).PurchReqId;
PurchPurchaseOrderHeader.PurchReqId = c;
// if(purchTable.PurchId == VendPurchOrderJourloc.PurchaseOrderId)
purchID = VendPurchOrderJour::findbyPurchaseOrderId(PurchPurchaseOrderHeader.PurchaseOrderId).PurchId;
purchID = “000402″;
PurchRecid = purchTable::find(purchID).RecId;
PurchDim = purchTable::find(purchID).DefaultDimension;
TableId = PurchReqLine::findByPurchId(purchID).PurchReqTable;
c = PurchReqTable::find(TableId).PurchReqId;
PurchPurchaseOrderHeader.PurchReqId = c;
while select DocuRef
where DocuRef.RefRecId == PurchRecid && DocuRef.RefCompanyId ==
purchTable.dataAreaId
&& DocuRef.RefTableId == purchTable.TableId
{
PurchPurchaseOrderHeader.Notes1 = DocuRef.Notes;
}
dimAttrValueSet = DimensionAttributeValueSet::find(PurchDim);
&& DocuRef.RefTableId == purchTable.TableId
{
PurchPurchaseOrderHeader.Notes1 = DocuRef.Notes;
}
dimAttrValueSet = DimensionAttributeValueSet::find(PurchDim);
// 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);
if(dimAttr.Name == “CostCenter”)
{
PurchPurchaseOrderHeader.Dim = dimAttr.Name;
PurchPurchaseOrderHeader.DimValue1 = dimAttrValue.getValue();
}
//info(dimAttr.Name + ‘ ‘ + dimAttrValue.getValue());
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);
if(dimAttr.Name == “CostCenter”)
{
PurchPurchaseOrderHeader.Dim = dimAttr.Name;
PurchPurchaseOrderHeader.DimValue1 = dimAttrValue.getValue();
}
//info(dimAttr.Name + ‘ ‘ + dimAttrValue.getValue());
}
}
//purchPurchaseOrderHeader.insert();
print PurchPurchaseOrderHeader.Dim;
print PurchPurchaseOrderHeader.DimValue1;
pause;
//purchPurchaseOrderHeader.insert();
print PurchPurchaseOrderHeader.Dim;
print PurchPurchaseOrderHeader.DimValue1;
pause;
}
///////////////////////
static void
DEV_Dimensionnew(Args _args)
{
// PurchTable PurchTable = PurchTable::find(“000404″);
DimensionAttributeValueSetStorage dimStorage;
Counter i;
PurchTable PurchTable;
while select PurchTable
dimStorage = DimensionAttributeValueSetStorage::find(PurchTable.DefaultDimension);
{
// PurchTable PurchTable = PurchTable::find(“000404″);
DimensionAttributeValueSetStorage dimStorage;
Counter i;
PurchTable PurchTable;
while select PurchTable
dimStorage = DimensionAttributeValueSetStorage::find(PurchTable.DefaultDimension);
//for (i=1 ; i<=
dimStorage.elements() ; i)
//{
info(strFmt(“%1 = %2 = %3″, DimensionAttribute::find(dimStorage.getAttributeByIndex(1)).Name,
dimStorage.getDisplayValueByIndex(1),dimStorage.getDisplayValueByDimensionAttribute(1)));
// getDisplayValueByDimensionAttribute
// }
}
//{
info(strFmt(“%1 = %2 = %3″, DimensionAttribute::find(dimStorage.getAttributeByIndex(1)).Name,
dimStorage.getDisplayValueByIndex(1),dimStorage.getDisplayValueByDimensionAttribute(1)));
// getDisplayValueByDimensionAttribute
// }
}
///////////
static void
getLedgerDimensionUsingDefaultDimensions(Args _args)
{
PurchTable PurchTable;
DocuRef DocuRef;
PurchPurchaseOrderHeader PurchPurchaseOrderHeader;
DimensionAttributeValueSet dimAttrValueSet;
DimensionAttributeValueSetItem dimAttrValueSetItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttr;
Common dimensionValueEntity;
{
PurchTable PurchTable;
DocuRef DocuRef;
PurchPurchaseOrderHeader PurchPurchaseOrderHeader;
DimensionAttributeValueSet dimAttrValueSet;
DimensionAttributeValueSetItem dimAttrValueSetItem;
DimensionAttributeValue dimAttrValue;
DimensionAttribute dimAttr;
Common dimensionValueEntity;
;
while select PurchTable{
// while select DocuRef where DocuRef.RefRecId == purchTable.RecId && DocuRef.RefCompanyId == purchTable.dataAreaId
// && DocuRef.RefTableId == purchTable.TableId
// {//&& purchTable.PurchId == “000400″;
// PurchPurchaseOrderHeader.Notes1 = DocuRef.Notes;
// }
dimAttrValueSet = DimensionAttributeValueSet::find(PurchTable.DefaultDimension);
while select PurchTable{
// while select DocuRef where DocuRef.RefRecId == purchTable.RecId && DocuRef.RefCompanyId == purchTable.dataAreaId
// && DocuRef.RefTableId == purchTable.TableId
// {//&& purchTable.PurchId == “000400″;
// PurchPurchaseOrderHeader.Notes1 = DocuRef.Notes;
// }
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);
if(dimAttr.Name == “CostCenter”)
{
PurchPurchaseOrderHeader.Dim = dimAttr.Name;
PurchPurchaseOrderHeader.DimValue1 = dimAttrValue.getValue();
}
//info(dimAttr.Name + ‘ ‘ + dimAttrValue.getValue());
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);
if(dimAttr.Name == “CostCenter”)
{
PurchPurchaseOrderHeader.Dim = dimAttr.Name;
PurchPurchaseOrderHeader.DimValue1 = dimAttrValue.getValue();
}
//info(dimAttr.Name + ‘ ‘ + dimAttrValue.getValue());
}
}
print PurchPurchaseOrderHeader.Dim;
print PurchPurchaseOrderHeader.DimValue1;
//print PurchPurchaseOrderHeader.Notes1;
print PurchPurchaseOrderHeader.Dim;
print PurchPurchaseOrderHeader.DimValue1;
//print PurchPurchaseOrderHeader.Notes1;
pause;
}
}
No comments:
Post a Comment