<?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-Beitraege</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://schweda.net/blog_rss.php?bid=565" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[AX 2012: Beispiel für den Einsatz einer Computed Column II]]></title>
<description><![CDATA[
<p>Der folgende Code zeigt, wie man mit Hilfe einer Computed Column eine einfache Multiplikation auf Datenbank-Ebene ausf&uuml;hren kann.
</p>


<pre class="pre_blog_axcode">
private static server str compColLineAmountMST()
{
     #define.ViewName(&quot;PurchLineExpanded&quot;)
     #define.DataSourceName(&quot;PurchLine&quot;)
 
     return SysComputedColumn::multiply(SysComputedColumn::returnField(#ViewName, #DataSourceName, fieldStr(PurchLine, PurchPrice)),
                                        SysComputedColumn::returnField(#ViewName, #DataSourceName, fieldStr(PurchLine, PurchQty))); 
}
</pre>


<p>Das Ergebnis sieht wie folgt aus (Spalte PurchLineAmount):
</p>


<p><a href="http://www.schweda.net/pictures/blogpics/ax2012_computedcolumnmultiplication.jpg" target="_blank"><img alt="Screenshot" height="272" src="http://www.schweda.net/pictures/blogpics/tb_ax2012_computedcolumnmultiplication.jpg" title="Screenshot" width="465" /></a>
</p>


<p>Kleiner Tipp: Es gibt noch zahlreiche Methoden wie die oben verwendete <em>multiply()</em>, mehr dazu auf der <a href="https://msdn.microsoft.com/en-us/library/syscomputedcolumn.aspx" target="_blank" title="MSDN">MSDN</a>.<br />
&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 09 May 2015 17:33:00 +0200</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=565</link>
<comments>https://www.schweda.net/blog_ax.php?bid=565</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=565</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=565</wfw:commentRss>
</item>
</channel>
</rss>	
