<?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://www.schweda.net/blog_rss.php?bid=446" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[AX 2012: SysOperation-Framework: Werte eines Data Contracts prüfen]]></title>
<description><![CDATA[
<p>Wenn man in einem Data Contract die Klasse <strong>SysOperationValidatable </strong>&uuml;ber den Befehl <em>implements </em>einbindet, kann man die dadurch zur Verf&uuml;gung stehende Methode <em>validate()</em> einbinden.
</p>

<p>Mit Hilfe dieser Methode k&ouml;nnen bereits bei der Eingabe von Werten im - beispielsweise vom SysOperation-Framework - generierten Dialog Pr&uuml;fungen durchf&uuml;hren. Die Methode funktioniert &auml;hnlich wie die gleichnamige Methode des RunBaseBatch-Frameworks.
</p>

<div class="div_blog_axcode">[DataContractAttribute]<br />
class TutorialSysOperationDataContract<br />
&nbsp;&nbsp;&nbsp; implements SysOperationValidatable<br />
{<br />
&nbsp;&nbsp;&nbsp; date dialogDate;<br />
}
</div>

<p>&nbsp;
</p>

<div class="div_blog_axcode">[DataMemberAttribute]<br />
public TransDate parmDialogDate(TransDate _dialogDate = dialogDate)<br />
{<br />
&nbsp;&nbsp;&nbsp; dialogDate = _dialogDate;<br />
&nbsp;&nbsp;&nbsp; return dialogDate;<br />
}
</div>

<p>&nbsp;
</p>

<div class="div_blog_axcode">public boolean validate()<br />
{<br />
&nbsp;&nbsp;&nbsp; boolean ret;<br />
<br />
&nbsp;&nbsp;&nbsp; ret = true;<br />
<br />
&nbsp;&nbsp;&nbsp; // Simple validation example<br />
&nbsp;&nbsp;&nbsp; if(this.parmDialogDate() &amp;&amp; this.parmDialogDate() &lt; systemDateGet())<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = checkFailed(strFmt(&quot;'%1' has to be greater/equal than %2.&quot;, &quot;@SYS128676&quot;, systemDateGet()));<br />
&nbsp;&nbsp;&nbsp; }<br />
<br />
&nbsp;&nbsp;&nbsp; return ret;<br />
}
</div>

<p>&nbsp;
</p>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Fri, 02 Nov 2012 22:13:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=446</link>
<comments>https://www.schweda.net/blog_ax.php?bid=446</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=446</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=446</wfw:commentRss>
</item>
</channel>
</rss>	
