-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFindLedgerDimension.xpp
45 lines (36 loc) · 1.4 KB
/
FindLedgerDimension.xpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//Author: Mafigu Huggins
//Email: [email protected]
//Tel: +263 782 326 160
//To find ledger Dimension using Financial Dimensions using X++
static void findledgerDimension()
{
LedgerDimensionAccount ledgerDimension, ledgerDimension4;
Struct struct = new Struct();
container ledgerDimensionCon;
DimensionDefault DimensionDefault;
DimensionValue mainaccount,businessunit,department, costCenter;
#define.BusinessUnit(‘BusinessUnit’)
#define.Department(‘Department’)
#define.CostCenter(‘CostCenter’)
#define.MainAccount(‘MainAccount’)
int i;
;
mainaccount = ‘110110’;
businessunit = ‘001’;
department = ‘022’;
ledgerDimensionCon = conNull();
struct.add(#MainAccount,mainaccount);
struct.add(#BusinessUnit,businessunit);
struct.add(#Department,department);
ledgerDimensionCon += struct.fields();
ledgerDimensionCon += struct.fieldName(1);
ledgerDimensionCon += struct.valueIndex(1);
ledgerDimensionCon += struct.fieldName(2);
ledgerDimensionCon += struct.valueIndex(2);
ledgerDimensionCon += struct.fieldName(3);
ledgerDimensionCon += struct.valueIndex(3);
DimensionDefault = AxdDimensionUtil::getDimensionAttributeValueSetId(ledgerDimensionCon);
ledgerDimension = DimensionStorage::getDefaultAccountForMainAccountNum(mainaccount);
ledgerDimension4 = DimensionDefaultingService::serviceCreateLedgerDimension(ledgerDimension, DimensionDefault);
info(strFmt(“%1”, ledgerDimension4));
}