The Below code is used for Inserting Financial Dimensions for a particular Customer through code.
static void BRR_Finance(Args _args)
{
CustTable custTable;
Struct struct = new Struct();
container ledgerDimension;
DimensionDefault DimensionDefault;
;
//set the values
struct.add("CostCenter", "OU_4740");
struct.add("BusinessUnit","00000005");
struct.add("Department","OU_4771");
struct.add("ExpensePurpose","Training");
ledgerDimension += struct.fields();
ledgerDimension += struct.fieldName(1);
ledgerDimension += struct.valueIndex(1);
ledgerDimension += struct.fieldName(2);
ledgerDimension += struct.valueIndex(2);
ledgerDimension += struct.fieldName(3);
ledgerDimension += struct.valueIndex(3);
ledgerDimension += struct.fieldName(4);
ledgerDimension += struct.valueIndex(4);
ttsBegin;
DimensionDefault = AxdDimensionUtil::getDimensionAttributeValueSetId(ledgerDimension);
//Select the Customer
custTable = CustTable::find("2003",true);
custTable.DefaultDimension = DimensionDefault;
custTable.update();
ttsCommit;
}
No comments:
Post a Comment