Показать сообщение отдельно
Старый 08.09.2012, 08:32   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
sumitsaxfactor: Remove a Financial Dimension Value
Источник: http://sumitsaxfactor.wordpress.com/...mension-value/
==============

Here is a job that can help you remove or blank out a financial dimension.

Note the Dimensions before executing this job



Job

staticvoid sgxRemoveWorkerDimension(Args _args)

{

/*

* We will Remove a worker dimension in this example

*/

CustTable custTable = CustTable::find(‘CUS-00004′); //Customer Record containing Financial Dimension

DimensionSHA1Hash hash; //To store the calculated hash for DimensionAttributeValueSet

DimensionAttribute dimAttr; // Contains the financial dimensions records

DimensionAttributeValue dimAttrValue; // Contains used financial dimension values

DimensionAttributeValueSet dimAttrValueSet; //Contains default dimension records

DimensionAttributeValueSetItem dimAttrValueSetItem; //Contains individual records for default dimensions

DimensionAttributeSetItem dimAttrSetItem; // Contains the number of dimensions active for a account structure ledger



HashKey valueKeyHashArray[]; //To store the has key of dimension in question

Map dimAttrRecId, dimAttrStr; //To store the dimension attribute recid and dimension attribute value display value

Set dimAttrValueRecId;

SetEnumerator setEnum;

int dimAttrCount, i;





//Initialize the map to store the backing entity types

dimAttrRecId = new Map(Types::Int64, Types::Integer);

dimAttrValueRecId = new Set(Types::Int64);

dimAttrStr = new Map(Types::Int64, Types::String);



//Find all the active dimensions for current ledger except main account and store there

//backing entity type in the map

whileselect RecId from dimAttr

orderby Name

where dimAttr.Type != DimensionAttributeType::MainAccount

join RecId from dimAttrSetItem

where dimAttrSetItem.DimensionAttribute == dimAttr.RecId &&

dimAttrSetItem.DimensionAttributeSet == DimensionCache::getDimensionAttributeSetForLedger()

{

dimAttrCount++;

dimAttrRecId.insert(dimAttr.RecId, dimAttrCount);

}



//initialize hash key array to null


<span><font face="Consolas"><font size="2">for (i = 1<font color="#000000">; i
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.