<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Doens.be &#187; User interaction</title>
	<atom:link href="http://www.doens.be/tag/user-interaction/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doens.be</link>
	<description></description>
	<lastBuildDate>Sat, 07 Jan 2012 04:20:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>The Ax Infolog</title>
		<link>http://www.doens.be/2010/05/the-ax-infolog/</link>
		<comments>http://www.doens.be/2010/05/the-ax-infolog/#comments</comments>
		<pubDate>Fri, 07 May 2010 05:00:25 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[Infolog]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[User interaction]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=535</guid>
		<description><![CDATA[Wel all know the small dialog that gives the user usefull information about what is happening in Ax. In this post I will tell u some more about this. You can add information to the Infolog by calling: Infolog.add(&#8230;) info(&#8230;) warning(&#8230;) or checkfailed(&#8230;) error(&#8230;) You can add some structure in it by using setPrefix(&#8230;) Using [...]]]></description>
			<content:encoded><![CDATA[<p>Wel all know the small dialog that gives the user usefull information about what is happening in Ax. In this post I will tell u some more about this.</p>
<p>You can add information to the Infolog by calling:</p>
<ul>
<li>Infolog.add(&#8230;)</li>
<li><a href="http://www.doens.be/wp-content/uploads/2010/05/icon_info.gif"><img class="alignnone size-full wp-image-536" title="icon_info" src="http://www.doens.be/wp-content/uploads/2010/05/icon_info.gif" alt="" width="17" height="14" /></a> info(&#8230;)</li>
<li><a href="http://www.doens.be/wp-content/uploads/2010/05/icon_warning.gif"><img class="alignnone size-full wp-image-537" title="icon_warning" src="http://www.doens.be/wp-content/uploads/2010/05/icon_warning.gif" alt="" width="17" height="16" /></a> warning(&#8230;) or checkfailed(&#8230;)</li>
<li><a href="http://www.doens.be/wp-content/uploads/2010/05/icon_error.gif"><img class="alignnone size-full wp-image-538" title="icon_error" src="http://www.doens.be/wp-content/uploads/2010/05/icon_error.gif" alt="" width="15" height="14" /></a> error(&#8230;)</li>
<li>You can add some structure in it by using setPrefix(&#8230;)</li>
<li>Using the Proxy-class for the Enterprise Portal</li>
</ul>
<p><a href="http://www.doens.be/wp-content/uploads/2010/05/infolog_FirstExample.png"><img class="alignnone size-full wp-image-545" title="infolog_FirstExample" src="http://www.doens.be/wp-content/uploads/2010/05/infolog_FirstExample.png" alt="" width="348" height="344" /></a><br />
<span id="more-535"></span><br/><br />
The <strong>info</strong>(), <strong>warning</strong>() and <strong>error</strong>() method are found in the Global class and can contain up to 3 arguments:</p>
<ul>
<li>a string <em>(mandatory) </em>: the string that is added to the infolog</li>
<li>a path to the Axapta Help <em>(optional)</em></li>
<li>an Infolog action <em>(optional)</em> : you can use this parameter to initiate a action, for example open the code editor or open a parameter-form when some parameters are missing. Depending on what action you want to trigger, you need to call the right method that extend from sysInfoAction.</li>
</ul>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;">SysInfoAction   sysInfoAction;
;
sysInfoAction <span style="color: #00007f;">=</span> SysInfoAction_Formrun<span style="color: #00007f;">::</span><span style="color: #000000;">newFormname</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">formstr</span><span style="color: #000000;">&#40;</span>HRMParameters<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;click on me&quot;</span><span style="color: #00007f;">,</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #00007f;">,</span> sysInfoAction<span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p><a href="http://www.doens.be/wp-content/uploads/2010/05/infolog_clickOnme.png"><img class="alignnone size-full wp-image-546" title="infolog_clickOnme" src="http://www.doens.be/wp-content/uploads/2010/05/infolog_clickOnme.png" alt="" width="348" height="344" /></a><br />
<br/><br />
Using the keyword <strong>Throw </strong>before info(), error() or warning will result in terminating the execution (or jump to catch statement) and a rollback of your transactions.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">throw</span> error<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Something bad happend&quot;</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p><a href="http://www.doens.be/wp-content/uploads/2010/05/infolog_throwerror1.png"><img class="alignnone size-full wp-image-554" title="infolog_throwerror" src="http://www.doens.be/wp-content/uploads/2010/05/infolog_throwerror1.png" alt="" width="348" height="323" /></a><br />
<br/><br />
The method <strong>setPrefix</strong>() will help you to group info(), warning() and error() messages with a header. using setPrefix() will make a indentation for your current block of code <em>(everything between { and }).</em> Leaving the code-block will automatically result in going one indentation back.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">int</span> i;
<span style="color: #0000ff;">int</span> j;
;
<span style="color: #0000ff;">setPrefix</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Testing out setPrefix&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">for</span> <span style="color: #000000;">&#40;</span>i<span style="color: #00007f;">=</span><span style="color: #000000;">1</span> ; i<span style="color: #00007f;">&amp;</span>lt;<span style="color: #00007f;">=</span><span style="color: #000000;">2</span> ; i<span style="color: #00007f;">++</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0000ff;">setPrefix</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Prefix %1&quot;</span><span style="color: #00007f;">,</span> i<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #0000ff;">for</span> <span style="color: #000000;">&#40;</span>j<span style="color: #00007f;">=</span><span style="color: #000000;">1</span> ; j<span style="color: #00007f;">&amp;</span>lt;<span style="color: #00007f;">=</span><span style="color: #000000;">3</span> ; j<span style="color: #00007f;">++</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		info<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">strfmt</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Info %1&quot;</span><span style="color: #00007f;">,</span> j<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://www.doens.be/wp-content/uploads/2010/05/infolog_setPrefic.png"><img class="alignnone size-full wp-image-547" title="infolog_setPrefic" src="http://www.doens.be/wp-content/uploads/2010/05/infolog_setPrefic.png" alt="" width="348" height="403" /></a><br />
<br/><br />
The <strong>checkFailed</strong>() method is a warning() method that returns a Boolean (alwais false). U can use this method when you want to display a warning and directly set a return value to false.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">Boolean</span> ret;
;
<span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">true</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    ret <span style="color: #00007f;">=</span> checkFailed<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Something is wrong&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
<span style="color: #0000ff;">return</span> ret;</pre></td></tr></table></div>

<p><a href="http://www.doens.be/wp-content/uploads/2010/05/infolog_checkFailed.png"><img class="alignnone size-full wp-image-558" title="infolog_checkFailed" src="http://www.doens.be/wp-content/uploads/2010/05/infolog_checkFailed.png" alt="" width="348" height="323" /></a><br />
<br/><br />
<strong>Note:</strong> The infolog can contain <strong>maximum 10000 lines</strong>. So try to limit the use of it. Building the output of the infolog usually happens at the end of the code you are executing and depending on the number of lines, it can take a while. You can limit the maximum number of lines under a header in a batch by setting the property<strong> infolog.errorsPerBatch(#)</strong>(). When this number is exceeded only the furst # will appear and Ax will give you a notification that their could be more errors.<br />
It is also possible to update the infolog while executing code by calling the method<strong> infolog.viewUpdate</strong>().<br />
<br/><br />
<strong>Using the infolog in the Enterprise Portal:</strong><br />
In the portal you can access the infolog by using the Proxy of the Enterprise Portal.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;
Proxy.Info objInfoLog = new Proxy.Info(this.AxSession.AxaptaAdapter);</pre></td></tr></table></div>

<p>Now, when you want to write something to the infolog you need to give a Enum with it, so the portal knows if the message you want to show is a info, warning or error. So pass through Proxy.Exception.Info, Proxy.Exception.Warning or Proxy.Exception.Error.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">objInfoLog.add(Proxy.Exception.Warning, &quot;My warning&quot;);</pre></td></tr></table></div>

<p><br/><br />
So in short thing you should <strong>keep in mind</strong> while using the Infolog-class:</p>
<ul>
<li>Use short &#038; informative messages</li>
<li>Choose the righty message level (info, warning, error)</li>
<li>Use actions, this simple trick is verry usefull for end-users</li>
<li>Limit the number of messages you send to the Infolog-dialog</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/05/the-ax-infolog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Catching a key-press</title>
		<link>http://www.doens.be/2010/03/catching-a-key-press/</link>
		<comments>http://www.doens.be/2010/03/catching-a-key-press/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 07:00:50 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Macro]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[User interaction]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=391</guid>
		<description><![CDATA[When you want to catch a key-stroke on a form, you can override the method task() The default method will look like this: public int task&#40;int _taskId&#41; &#123; int ret; ret = super&#40;_taskId&#41;; // write you're code here return ret; &#125; Now you just need to check the _taskId, to know witch key you have [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to catch a key-stroke on a form, you can override the method <strong>task()</strong><br />
The default method will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">int</span> task<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">int</span> _taskId<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0000ff;">int</span> ret;
    ret <span style="color: #00007f;">=</span> <span style="color: #0000ff;">super</span><span style="color: #000000;">&#40;</span>_taskId<span style="color: #000000;">&#41;</span>;
    <span style="color: #007f00;">// write you're code here</span>
    <span style="color: #0000ff;">return</span> ret;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Now you just need to check the <em>_taskId</em>, to know witch key you have stroke. You can compare this withe the values from the Task-macro.</p>

<div class="wp_syntax"><div class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #007f00;">// Task-ID values, to be used with formControl's</span>
<span style="color: #007f00;">// return value from the method task()</span>
<span style="color: #007f00;">//--------------------------------------------------------</span>
&nbsp;
#define.<span style="color: #000000;">taskF1</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">257</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskCtrlQ</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">264</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskEnter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">288</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskShiftEnter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">307</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">260</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskSave</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">272</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskShortCutMenuKey</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">519</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskAlt</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">520</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskCut</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">770</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskCopy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">771</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskPaste</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">772</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskDeleteKey</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">773</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskSelectAll</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">778</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskUndo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">769</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskRedo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">791</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskArrowUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1281</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskArrowDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1282</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskArrowLeft</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1283</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskArrowRight</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1284</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #007f00;">// PgUp and PgDn are the numerical keyboard page up and page down commands.</span>
#define.<span style="color: #000000;">taskPgUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1285</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskPgDn</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1286</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskEsc</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1313</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskNextRecord</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2817</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskPrevRecord</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2818</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskDeleteRecord</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2832</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskPageDown</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2819</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskPageUp</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2820</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskTab</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2827</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2827</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskPrev</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2828</span><span style="color: #000000;">&#41;</span>
&nbsp;
#define.<span style="color: #000000;">taskShortCutMenuFilter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2844</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskShortCutMenuFind</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">799</span><span style="color: #000000;">&#41;</span>
#define.<span style="color: #000000;">taskFilter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">2837</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #007f00;">// max task id</span>
#define.<span style="color: #000000;">taskLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">8191</span><span style="color: #000000;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2010/03/catching-a-key-press/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lock on form elements in Dynamics Ax</title>
		<link>http://www.doens.be/2009/11/lock-on-form-elemnts-in-dynamics-ax/</link>
		<comments>http://www.doens.be/2009/11/lock-on-form-elemnts-in-dynamics-ax/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 20:18:30 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[User interaction]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=286</guid>
		<description><![CDATA[Some end-users like to make their own modifications on their forms (right-click on the form &#8211;&#62; setup). Last week I had a customer that was not able to do this trick any more. After some research and a tip from a colleague, I came to the conclusion that this had something to do with overriding [...]]]></description>
			<content:encoded><![CDATA[<p>Some end-users like to make their own modifications on their forms (right-click on the form &#8211;&gt; setup). Last week I had a customer that was not able to do this trick any more. After some research and a tip from a colleague, I came to the conclusion that this had something to do with overriding the methods tabChange() and tabChanged() on the form.</p>
<p>Solution:<br />
Use the methods pageActivated() / allowPageDeactivate() instead.</p>
<p>Source / More info:<br />
<a href="http://dynamics-ax.blogspot.com/2007/06/yellow-lock-in-dynamics-ax-401.html">http://dynamics-ax.blogspot.com/2007/06/yellow-lock-in-dynamics-ax-401.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2009/11/lock-on-form-elemnts-in-dynamics-ax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

