<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="https://www.schweda.net/style_feed.css" ?>
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:atom="http://www.w3.org/2005/Atom"	
	xmlns:dc="http://purl.org/dc/elements/1.1/" > 
<channel>
    <title>schweda.net - Blog</title>
    <link>https://www.schweda.net/</link>
    <description>schweda.net - Blog - Blog posts</description>
    <language>de-at</language>
    <copyright>Copyright 2006-2026</copyright>
    <generator>schweda.net</generator>
    <managingEditor>heinz.schweda@schweda.net (Heinz Schweda)</managingEditor>
    <webMaster>heinz.schweda@schweda.net (Heinz Schweda)</webMaster>
    <category>Blog</category>
	<atom:link href="https://www.schweda.net/blog_rss.php?bid=553" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[AX 2012: Erstellen einer DefaultDimension/LedgerDimension]]></title>
<description><![CDATA[
<p>Nachstehend ein Code-Beispiel, wie man eine RecId vom Typ <strong>DefaultDimension </strong>f&uuml;r mehrere Dimensionen generieren kann.<br />
Anschlie&szlig;end wird diese DefaultDimension mit einem Hauptkonto zu einer RecId vom Typ <strong>LedgerDimension </strong>kombiniert.
</p>


<pre class="pre_blog_axcode">
static void buildDefaultAndLedgerDimension(Args _args)
{
    DimensionAttributeValueSetStorage dimensionAttributeValueSetStorage;
    DimensionAttribute dimensionAttribute;
    DimensionAttributeValue dimensionAttributeValue;
    DimensionDefault dimensionDefault;
    LedgerDimensionAccount ledgerDimensionAccount;

    dimensionAttributeValueSetStorage = new DimensionAttributeValueSetStorage();

    // BusinessUnit
    dimensionAttribute = DimensionAttribute::findByName(&#39;BusinessUnit&#39;);
    if(dimensionAttribute)
    {
        dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute, &#39;069&#39;, false, true);
        dimensionAttributeValueSetStorage.addItem(dimensionAttributeValue);
    }

    // CostCenter
    dimensionAttribute = DimensionAttribute::findByName(&#39;CostCenter&#39;);
    if(dimensionAttribute)
    {
        dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute, &#39;010&#39;, false, true);
        dimensionAttributeValueSetStorage.addItem(dimensionAttributeValue);
    }

    // Department
    dimensionAttribute = DimensionAttribute::findByName(&#39;Department&#39;);
    if(dimensionAttribute)
    {
        dimensionAttributeValue = DimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute, &#39;024&#39;, false, true);
        dimensionAttributeValueSetStorage.addItem(dimensionAttributeValue);
    }
 
    dimensionDefault = dimensionAttributeValueSetStorage.save();

    // Merge main account and source dimension values and return RecId which can be used as ledgerDimension
    ledgerDimensionAccount = DimensionDefaultingService::serviceCreateLedgerDimension(DimensionStorage::getDefaultAccountForMainAccountNum(&quot;110110&quot;),
                                                                                      dimensionDefault);

    info(strFmt(&quot;Default dimension recId: %1&quot;, dimensionDefault));
    info(strFmt(&quot;DefaultDimension (Source RecId): %1 LedgerDimension (Merged RecId): %2&quot;, dimensionDefault, ledgerDimensionAccount));
}
</pre>



<p>Notiz: Aufmerksamen Lesern ist sicherlich nicht entgangen, da&szlig; ich beides bereits in anderen Beitr&auml;gen geposted habe. Dieser Beitrag ist lediglich eine Kombination davon.
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sun, 14 Dec 2014 09:29:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=553</link>
<comments>https://www.schweda.net/blog_ax.php?bid=553</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=553</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=553</wfw:commentRss>
</item>
<item>
<title>Kommentar von Denis</title>
<description><![CDATA[Hi,

your post saved the day. Thanks!]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 27 Mar 2020 15:01:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=553</link>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=553</guid>
<author>Denis</author>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heinz Schweda</dc:creator>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=553</wfw:commentRss>
</item>
<item>
<title>Kommentar von Heinz Schweda</title>
<description><![CDATA[Glad that one of my contributions could help you!]]></description>
<category></category>
<pubDate>Sat, 28 Mar 2020 18:08:00 +0100</pubDate>
<link>https://www.schweda.net/blog.php?bid=553</link>
<guid isPermaLink="true">https://www.schweda.net/blog.php?bid=553</guid>
<author>Heinz Schweda</author>
<dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Heinz Schweda</dc:creator>
<wfw:commentRss>https://www.schweda.net/blog.php?bid=553</wfw:commentRss>
</item>
</channel>
</rss>	
