<?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; labels</title>
	<atom:link href="http://www.doens.be/tag/labels/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>About labels</title>
		<link>http://www.doens.be/2009/07/about-labels/</link>
		<comments>http://www.doens.be/2009/07/about-labels/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 15:32:55 +0000</pubDate>
		<dc:creator>Jeroen Doens</dc:creator>
				<category><![CDATA[Dynamics AX]]></category>
		<category><![CDATA[labels]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[X++]]></category>

		<guid isPermaLink="false">http://www.doens.be/?p=159</guid>
		<description><![CDATA[In Ax there is a class called SysLabel. When you want to expiriment with labels, this is the place to be. Some examples: You want to find a label in a specific language. There are a few ways to do this, for you to chos witch fits best. 1 2 3 4 5 // Method [...]]]></description>
			<content:encoded><![CDATA[<p>In Ax there is a class called <a href="http://msdn.microsoft.com/en-us/library/aa621718.aspx">SysLabel</a>. When you want to expiriment with labels, this is the place to be.<br />
Some examples:</p>
<p>You want to find a label in a specific language. There are a few ways to do this, for you to chos witch fits best.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="xpp" style="font-family:monospace;"><span style="color: #007f00;">// Method 1:</span>
info<span style="color: #000000;">&#40;</span>Syslabel<span style="color: #00007f;">::</span><span style="color: #000000;">labelId2String</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">literalstr</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS115063&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span> <span style="color: #ff0000;">&quot;en-us&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #007f00;">//Method2:</span>
info<span style="color: #000000;">&#40;</span>Syslabel<span style="color: #00007f;">::</span><span style="color: #000000;">getLabelInstance</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;nl-be&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">extractString</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS115063&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>Or you can do it the long way</p>

<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;"><span style="color: #007f00;">// Method 3:</span>
SysLabel sysLabel <span style="color: #00007f;">=</span> <span style="color: #0000ff;">new</span> SysLabel<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'en-us'</span><span style="color: #000000;">&#41;</span>;
;
info<span style="color: #000000;">&#40;</span>sysLabel.<span style="color: #000000;">extractString</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'@SYS115063'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>A other cool thing you can do with labels is when you have the label in language &#8216;X&#8217;, lookup the corresponding labelId (@SYS&#8230;).</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;">info<span style="color: #000000;">&#40;</span>Syslabel<span style="color: #00007f;">::</span><span style="color: #000000;">getLabelInstance</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;en-us&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">searchFirst</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;Microsoft Dynamics Ax&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>When you had a labelId and you want to verify if it is really a label, there is the static method isLabel.</p>

<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;"><span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span>SysLabel<span style="color: #00007f;">::</span><span style="color: #000000;">isLabelId</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">literalstr</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@SYS115063&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    info<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;ok&quot;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>And finally when you want to modify a label from code, this is possible by modifying a SysLabel-instance.</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;">Syslabel<span style="color: #00007f;">::</span><span style="color: #000000;">getLabelInstance</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;en-us&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #000000;">modify</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">literalstr</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">&quot;@JDN1&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #00007f;">,</span> <span style="color: #ff0000;">&quot;new label value&quot;</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p><em><strong>Note:</strong> this last change wil automaticly leave a trace in the label log.</em></p>
<p>So, knowing all this you can create your won improved label-editor. <img src='http://www.doens.be/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.doens.be/2009/07/about-labels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

