Insert of list of Financial Dimensions values under a specific dimension name(in master) through x++ code

The Crucial steps to be remembered while performing this operations are as follows. Untitled

Here is the code………

static void listofFinDimValues(Args _args)

DimensionAttribute dimensionAttribute;
RecId financialcategoryRecid;
LogisticsAddressCountryRegion logisticsAddressCountryRegion;
DimensionFinancialTag dimensionFinancialTag;
FinancialTagCategory financialTagCategory;
dimensionAttribute = DimensionAttribute::findByName(‘Country’);  // 1. Find DimAttribute record financialcategoryRecid = dimensionAttribute.financialTagCategory(); // 2.Call financialTagCategory() 

while select * from logisticsAddressCountryRegion
select dimensionFinancialTag where
dimensionFinancialTag.FinancialTagCategory == financialcategoryRecid && 
DimensionFinancialTag.Value == LogisticsAddressCountryRegion.CountryRegionId;

// This select statement prevents to add existing records.
// 3. Create new DimensionFinancialTag record with the category and your Value and Description. dimensionFinancialTag.Value = logisticsAddressCountryRegion.CountryRegionId; dimensionFinancialTag.Description = LogisticsAddressCountryRegionTranslation::find(logisticsAddressCountryRegion.CountryRegionId).ShortName;
dimensionFinancialTag.FinancialTagCategory = financialcategoryRecid; dimensionFinancialTag.insert();

Happy DaXing………


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: