<?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=179" rel="self" type="application/rss+xml" />
<item>
<title><![CDATA[GoToMainTable mal anders]]></title>
<description><![CDATA[
<p>Die &quot;Gehe zum Haupttabellenformular&quot;-Funktion in AX ist ja was feines. Abh&auml;ngig von Datenbank-Relationen k&uuml;mmert sich im Normalfall AX vollkommen autark um diese Funktion. Und wenn einmal keine Relationen zur Verf&uuml;gung stehen sollten, kann man durch &Uuml;berschreiben der Methode jumpRef mit nachstehenden Code auf beinahe jedem Eingabe-Feld unter Angabe der Tabelle und des betroffenen Tabellenfeldes - im Beispiel die Debitorengruppe, AX dazu bewegen, das entsprechende Formular zu &ouml;ffnen.
</p>

<p>&nbsp;
</p>

<div class="div_blog_axcode"><font color="#0000ff">public void</font> jumpRef()<br />
{<br />
&nbsp;&nbsp;&nbsp; sysDictField sysDictField;<br />
&nbsp;&nbsp;&nbsp; menufunction menufunction;<br />
&nbsp;&nbsp;&nbsp; ;<br />
<br />
&nbsp;&nbsp;&nbsp; sysDictField = <font color="#0000ff">new</font> sysDictField(<font color="#0000ff">tableNum</font>(CustTable), <font color="#0000ff">fieldNum</font>(CustTable, CustGroup));<br />
<br />
&nbsp;&nbsp;&nbsp; menufunction = sysDictField.gotoMainTableMenuFunction();<br />
&nbsp;&nbsp;&nbsp; <font color="#0000ff">if</font>(menufunction)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; menufunction.run();<br />
}
</div>

<p>Funktioniert in AX 3.0 und 4.0. Das obige Code-Schnippsel &ouml;ffnet wirklich einfach nur das Formular, einen bestimmten Datensatz innerhalb desselben (z.B. abh&auml;ngig vom bereits eingetragenen Wert im Eingabe-Feld), kann man damit nicht vorselektieren.
</p>

<p>&Uuml;brigens, in dem Zusammenhang: Manchmal macht es Sinn, diese Funktion zu deaktivieren. Dazu kann man entweder das <em>super()</em> aus der Methode <em>context </em>entfernen, dann fehlt dem betroffenen Feld aber das komplette Kontext-Men&uuml;.
</p>

<div class="div_blog_axcode"><font color="#0000ff">public void</font> context()<br />
{<br />
&nbsp;&nbsp;&nbsp; <font color="#007d00">//super();</font><br />
}
</div>

<p>Zumindest etwas eleganter ist es, das <em>super()</em> aus der Methode <em>jumpRef </em>zu entfernen, dann ist zwar der Men&uuml;punkt im Kontext-Men&uuml; nach wie vor vorhanden, aber ohne Funktion.
</p>

<div class="div_blog_axcode"><font color="#0000ff">public void</font> jumpRef()<br />
{<br />
&nbsp;&nbsp;&nbsp; <font color="#007d00">//super();</font><br />
}
</div>]]></description>
<category>Microsoft Dynamics AX (Axapta)</category>
<pubDate>Sat, 08 Dec 2007 13:58:00 +0100</pubDate>
<link>https://www.schweda.net/blog_ax.php?bid=179</link>
<comments>https://www.schweda.net/blog_ax.php?bid=179</comments>
<guid isPermaLink="true">https://www.schweda.net/blog_ax.php?bid=179</guid>
<author>heinz.schweda@schweda.net (Heinz Schweda)</author>
<wfw:commentRss>https://www.schweda.net/blog_ax.php?bid=179</wfw:commentRss>
</item>
</channel>
</rss>	
