<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Nico's CRM</title>
	
	<link>http://blog.nicocrm.com</link>
	<description>Programming, technology, and CRM - from a Belgian programmer exiled to Missouri</description>
	<lastBuildDate>Sun, 15 Aug 2010 15:57:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/chivinou" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="chivinou" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>SalesLogix Bundle Sort</title>
		<link>http://blog.nicocrm.com/2010/08/15/saleslogix-bundle-sort/</link>
		<comments>http://blog.nicocrm.com/2010/08/15/saleslogix-bundle-sort/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 15:57:43 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=389</guid>
		<description><![CDATA[Published a little utility for sorting items within a SalesLogix bundle (don&#8217;t you hate it when the Architect decides to &#8220;shuffle&#8221; the items you took 20 minutes to arrange?).  I don&#8217;t work that much with the SalesLogix LAN client anymore but this was irritating enough that I had to do something about it.
It is [...]]]></description>
			<content:encoded><![CDATA[<p>Published a little utility for sorting items within a SalesLogix bundle (don&#8217;t you hate it when the Architect decides to &#8220;shuffle&#8221; the items you took 20 minutes to arrange?).  I don&#8217;t work that much with the SalesLogix LAN client anymore but this was irritating enough that I had to do something about it.</p>
<p>It is on the <a href="http://code.msdn.microsoft.com/slxbundlesort">MSDN code gallery</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/08/15/saleslogix-bundle-sort/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Visual Studio is waiting for an operation to complete</title>
		<link>http://blog.nicocrm.com/2010/08/07/microsoft-visual-studio-is-waiting-for-an-operation-to-complete/</link>
		<comments>http://blog.nicocrm.com/2010/08/07/microsoft-visual-studio-is-waiting-for-an-operation-to-complete/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 19:43:35 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=387</guid>
		<description><![CDATA[This is not an uncommon message&#8230; but I hope this could help someone who is confronted with the same issue I was.
I found I was getting the error every time I started Visual Studio in the morning, with Visual Studio hanging for a looong time&#8230; but not in the afternoon&#8230; crazy uh?  The difference [...]]]></description>
			<content:encoded><![CDATA[<p>This is not an uncommon message&#8230; but I hope this could help someone who is confronted with the same issue I was.</p>
<p>I found I was getting the error every time I started Visual Studio in the morning, with Visual Studio hanging for a looong time&#8230; but not in the afternoon&#8230; crazy uh?  The difference is in the morning I connect to my workstation via remote desktop&#8230; and usually in the afternoon I am physically at the keyboard.  It turns out the delay was caused by the remote desktop clipboard helper&#8230; an application called rdpclip.exe.  Killing the application solved the problem (though it does prevent pasting via remote desktop, obviously, but I can live without that)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/08/07/microsoft-visual-studio-is-waiting-for-an-operation-to-complete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SLX Generic “Disable Form” function</title>
		<link>http://blog.nicocrm.com/2010/04/14/slx-generic-disable-form-function/</link>
		<comments>http://blog.nicocrm.com/2010/04/14/slx-generic-disable-form-function/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 21:02:15 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=383</guid>
		<description><![CDATA[This is a generic function to enable / disable all controls on a form from server-side, except for buttons.  Call as LockForm(this, true) or LockForm(this, false).  Watch out as values will be persisted between postbacks (e.g. when browsing through SalesLogix entities).  Also, it won&#8217;t go through a main view tab.


/// &#60;summary&#62;
/// Enable [...]]]></description>
			<content:encoded><![CDATA[<p>This is a generic function to enable / disable all controls on a form from server-side, except for buttons.  Call as LockForm(this, true) or LockForm(this, false).  Watch out as values will be persisted between postbacks (e.g. when browsing through SalesLogix entities).  Also, it won&#8217;t go through a main view tab.</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// Enable / disable all controls on the form</span>
<span class="rem">/// &lt;/summary&gt;</span>
<span class="rem">/// &lt;param name="islocked"&gt;&lt;/param&gt;</span>
<span class="kwrd">private</span> <span class="kwrd">void</span> LockForm(Control parent, <span class="kwrd">bool</span> islocked)
{
    <span class="kwrd">foreach</span> (Control c <span class="kwrd">in</span> parent.Controls)
    {
        <span class="kwrd">if</span> (c <span class="kwrd">is</span> IButtonControl || c <span class="kwrd">is</span> SmartPartToolsContainer)
            <span class="kwrd">continue</span>;
        <span class="kwrd">if</span> (c.Controls.Count &gt; 0)
            LockForm(c, islocked);

        PropertyInfo pr = c.GetType().GetProperty(<span class="str">"ReadOnly"</span>);
        <span class="kwrd">if</span> (pr != <span class="kwrd">null</span>)
        {
            pr.SetValue(c, islocked, <span class="kwrd">null</span>);
        }
        <span class="kwrd">else</span>
        {
            pr = c.GetType().GetProperty(<span class="str">"Enabled"</span>);
            <span class="kwrd">if</span> (pr != <span class="kwrd">null</span>)
            {
                pr.SetValue(c, !islocked, <span class="kwrd">null</span>);
            }
        }
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/04/14/slx-generic-disable-form-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorted SLX Lookup</title>
		<link>http://blog.nicocrm.com/2010/04/08/sorted-slx-lookup/</link>
		<comments>http://blog.nicocrm.com/2010/04/08/sorted-slx-lookup/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 18:56:03 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=372</guid>
		<description><![CDATA[One little &#8220;nicety&#8221; of the lookups in the web client is we no longer have to add a fake condition to force them to populate when they are open &#8211; one can simply add an &#8220;InitializeLookup=true&#8221; parameter to obtain that effect.
Unfortunately there is a serious usability drawback in the current version &#8211; the records are [...]]]></description>
			<content:encoded><![CDATA[<p>One little &#8220;nicety&#8221; of the lookups in the web client is we no longer have to add a fake condition to force them to populate when they are open &#8211; one can simply add an &#8220;InitializeLookup=true&#8221; parameter to obtain that effect.</p>
<p>Unfortunately there is a serious usability drawback in the current version &#8211; the records are not sorted by default.  So if there are more than a handful of them the user still has to click on the search button to get them to sort, which defeats the purpose of getting the lookup to pre-populate.</p>
<p>You can fix the problem in several ways.  The first is to add a little piece of javascript in your code behind to force the sort&#8230; this is rather unobtrusive and easy to test so if you are only fixing one form it&#8217;s probably the way to go:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
ScriptManager.RegisterStartupScript(<span class="kwrd">this</span>, GetType(), Guid.NewGuid().ToString(),
            <span class="str">"$(document).ready(function() {"</span> +
            lueLinkOpp.ClientID + <span class="str">@"_luobj.initGrid = function (seedValue, reload) {
                LookupControl.prototype.initGrid.apply(this, [seedValue, reload]);
                this.getGrid().getNativeGrid().getStore().setDefaultSort('CreateDate');
            }
            });
            "</span>, <span class="kwrd">true</span>);
</pre>
<p>It looks pretty yucky, but hey, it works.</p>
<p>If there are more than a handful of lookups, or if you want the changes to apply also on QuickForms, you&#8217;ll probably want to package them into a user control, something like this:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">class</span> FixSlxLookup : LookupControl
{
    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// Add the sorting hack.</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="rem">/// &lt;param name="e"&gt;&lt;/param&gt;</span>
    <span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> OnPreRender(EventArgs e)
    {
        <span class="kwrd">base</span>.OnPreRender(e);
        <span class="kwrd">if</span> (InitializeLookup &amp;&amp; LookupProperties.Count &gt; 0)
        {
            ScriptManager.RegisterStartupScript(<span class="kwrd">this</span>, GetType(), Guid.NewGuid().ToString(),
                <span class="str">@"$(document).ready(function() { setTimeout(function() {
                    "</span> + <span class="kwrd">this</span>.ClientID + <span class="str">@"_luobj.initGrid = function(seedValue, reload) {
                        LookupControl.prototype.initGrid.apply(this, [seedValue, reload]);
                        this.getGrid().getNativeGrid().getStore().setDefaultSort('"</span> + <span class="kwrd">this</span>.LookupProperties[0].PropertyName + <span class="str">@"');
                    };
                }, 500) });"</span>, <span class="kwrd">true</span>);
        }
    }
}</pre>
<p>Once you place the control in your own assembly, one tiny problem remains &#8211; by default the lookup control will try to locate the image for the button in the containing assembly.  So you need to adjust that in order to make it look in the original SalesLogix assembly:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// Initialize the lookup image if necessary</span>
<span class="rem">/// &lt;/summary&gt;</span>
<span class="rem">/// &lt;param name="e"&gt;&lt;/param&gt;</span>
<span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> OnInit(EventArgs e)
{
    <span class="kwrd">base</span>.OnInit(e);
    <span class="rem">// Fix the image - by default the SLX controls tries to load it from the current type's assembly.</span>
    <span class="rem">// since this is a subclass of LookupControl it is not in the "correct" assembly anymore.</span>
    <span class="rem">// this fix ensures that the image is loaded from the original assembly</span>
    <span class="kwrd">if</span> (<span class="kwrd">this</span>.ViewState[<span class="str">"LookupImageURL"</span>] == <span class="kwrd">null</span>)
        LookupImageURL = <span class="kwrd">this</span>.Page.ClientScript.GetWebResourceUrl(<span class="kwrd">typeof</span>(LookupControl), <span class="str">"Sage.SalesLogix.Web.Controls.Resources.Find_16x16.gif"</span>);
}</pre>
<p>If you want to have it used in QuickForms you&#8217;ll have to adjust the QuickForm template &#8211; there is an example of how to do that in a <a href="http://blog.nicocrm.com/2009/10/05/simple-picklist-enabling-picklist-manager-options-for-the-web-client/">previous article</a>.</p>
<p>The fixed lookup is available as part of <a href="http://github.com/nicocrm/OpenSlx">OpenSlx</a>, but it just has the 2 above functions so you can simply rip those instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/04/08/sorted-slx-lookup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenSlx Library</title>
		<link>http://blog.nicocrm.com/2010/03/22/openslx-library/</link>
		<comments>http://blog.nicocrm.com/2010/03/22/openslx-library/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 16:54:13 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=348</guid>
		<description><![CDATA[Just wanted to do a quick post to introduce the OpenSlx library I mentioned in the previous post about SimpleLookup.  The library is available from GitHub at http://github.com/nicocrm/OpenSlx.  It is free to use in your own customizations, or you can rip code out of it and put it into your own stuff, though [...]]]></description>
			<content:encoded><![CDATA[<p>Just wanted to do a quick post to introduce the OpenSlx library I mentioned in the previous post about SimpleLookup.  The library is available from GitHub at <a href="http://github.com/nicocrm/OpenSlx">http://github.com/nicocrm/OpenSlx</a>.  It is free to use in your own customizations, or you can rip code out of it and put it into your own stuff, though as it is placed under the GPL license there are a few limitations:</p>
<ul>
<li>you can take the OpenSlx library, modify it, and redistribute it as part of a customization, without having to publish it (though you would have to make the source code available to the customer, at their request, which is the usual business model anyway).  The same apply to ripping out code &#8211; you can rip the code and put it into your own customizations, without having to publish those (other than to the user of the code, i.e. the customer &#8211; this does not include the actual end users, either SalesLogix users, or their own customers accessing SalesLogix via customer portal)</li>
<li>you can take the OpenSlx library, unmodified, and include it as part of a proprietary component &#8211; you would have to make available any modification you make to OpenSlx, or any derived work (e.g. if you were to create a subclass), but other parts of your package would not be affected</li>
<li>you can&#8217;t take the OpenSlx library, add some controls to it (or fix some of the existing ones), and resell it as a proprietary component &#8211; this is the kind of change that I hope would be redistributed</li>
<li>you can&#8217;t rip some code from the OpenSlx library, and include it into your own, proprietary component which you resell as a software package &#8211; you have to leave the code separated.  However you can rip some code, and include it into your own open source components &#8211; they will have to be released under the GPL as well, though</li>
</ul>
<p><b>2010-06-27</b>: I changed the license to Apache, so most of the restrictions above do not hold anymore, even though I still hope that you would contribute improvements back to OpenSlx.  Without getting into details, this was the only practical way for me to be able to keep contributing to the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/03/22/openslx-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Lookup – for Slx Web</title>
		<link>http://blog.nicocrm.com/2010/03/15/simple-lookup-for-slx-web/</link>
		<comments>http://blog.nicocrm.com/2010/03/15/simple-lookup-for-slx-web/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 21:31:33 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=341</guid>
		<description><![CDATA[This is going to be another quickie because I am in a hurry!
One of the most boring tasks when creating custom smart parts is setting up the lookups.  There is next to no help from intellisense, so it takes a while to get right in the first place, but worse than that, if the [...]]]></description>
			<content:encoded><![CDATA[<p>This is going to be another quickie because I am in a hurry!</p>
<p>One of the most boring tasks when creating custom smart parts is setting up the lookups.  There is next to no help from intellisense, so it takes a while to get right in the first place, but worse than that, if the user wants to add a column to a lookup you have to go through ALL the forms that have that lookup and add it by hand (this is actually a problem with QuickForms too, not just custom smart part).  What a huge usability setback from the LAN client where they can just design their lookups in the Administrator.</p>
<p>In order to (partly) remedy that I created a component called &#8220;SimpleLookup&#8221; that runs through the Lookup table meta-data and populates the LookupProperties collection accordingly.  So basically you create the lookup as:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">OpenSlx:SimpleLookup</span> <span class="attr">LookupName</span><span class="kwrd">="ACCOUNT:ACCOUNT"</span>
   <span class="attr">LookupEntityName</span><span class="kwrd">="Account"</span> <span class="attr">ID</span><span class="kwrd">="lueAssignDistributor"</span>
   <span class="attr">LookupBindingMode</span><span class="kwrd">="String"</span> <span class="attr">AutoPostBack</span><span class="kwrd">="true"</span>
   <span class="attr">LookupEntityTypeName</span><span class="kwrd">="Sage.SalesLogix.Entities.Account, Sage.SalesLogix.Entities"</span>
   <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;</span></pre>
<p>The LookupName part is the important part &#8211; you can either put the Lookup Name (as defined in the lookup manager) or the search field (similar to how we used to reference lookups in the LAN client).  Now when you want to add a column you can add it in the familiar lookup manager (though it is cached for efficiency so it may still not show up for a few minutes or until the application pool is recycled).</p>
<p>This SimpleLookup is part of a growing collection of components that I am able to make available as open source &#8211; it is available on GitHub at <a href="http://github.com/nicocrm/OpenSlx">http://github.com/nicocrm/OpenSlx</a>, along with a few other pieces like the <a href="http://blog.nicocrm.com/2009/10/05/simple-picklist-enabling-picklist-manager-options-for-the-web-client/">SimplePicklist</a> I blogged about before.  Note that it won&#8217;t handle the more exotic lookup definitions (in particular any link used in the lookup must also be defined as a relationship in the Application Architect) so be sure to test the particular configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/03/15/simple-lookup-for-slx-web/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Validation of SalesLogix Lookup Controls</title>
		<link>http://blog.nicocrm.com/2010/03/08/validation-of-saleslogix-lookup-controls/</link>
		<comments>http://blog.nicocrm.com/2010/03/08/validation-of-saleslogix-lookup-controls/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 23:44:22 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=333</guid>
		<description><![CDATA[OK so I am really, really loving JQuery lately.  This is a neat use of how to add a custom validator for a lookup control in SalesLogix.  The lookups have this &#8220;Required&#8221; property which you can turn on to make them required, but this has 2 major flaws:

Can&#8217;t specify the validation group, in [...]]]></description>
			<content:encoded><![CDATA[<p>OK so I am really, really loving JQuery lately.  This is a neat use of how to add a custom validator for a lookup control in SalesLogix.  The lookups have this &#8220;Required&#8221; property which you can turn on to make them required, but this has 2 major flaws:</p>
<ul>
<li>Can&#8217;t specify the validation group, in case you want the lookup to only be validated in certain cases</li>
<li>More importantly, can&#8217;t specify an error message, so you are left with the default tiny-ish red asterisk.  I don&#8217;t know about you but I like my error message to be big, bold, and explicit.</li>
</ul>
<p>So we have this RequiredFieldValidator, part of the standard ASP.NET controls.  This is so handy for validating textboxes but if you try to have it validate a lookup you will get this beautiful error message:</p>
<p><code>Control 'luePurchContact' referenced by the ControlToValidate property of '' cannot be validated.</code></p>
<p>There is a customvalidator that lets you specify your own validation function, and you can do that.  This would look something like:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
 <span class="kwrd">&lt;</span><span class="html">asp:CustomValidator</span> <span class="attr">ID</span><span class="kwrd">="CustomValidator2"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ValidationGroup</span><span class="kwrd">="SubmitCredit"</span> <span class="attr">Text</span><span class="kwrd">="*"</span> <span class="attr">OnServerValidate</span><span class="kwrd">="luePurchContact_Validate"</span>
                <span class="attr">ErrorMessage</span><span class="kwrd">="Please select Purchasing Contact"</span><span class="kwrd">/&gt;</span></pre>
<p>and then in the code behind:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
    <span class="kwrd">void</span> luePurchContact_Validate(<span class="kwrd">object</span> source, ServerValidateEventArgs args)
    {
        args.IsValid = (luePurchContact.LookupResultValue != <span class="kwrd">null</span>);
    }</pre>
<p>The big problem here is that this requires a postback.  Postbacks are slow.  You want to avoid them as much as possible.  They waste bandwidth, server CPU, client CPU, they look ugly, they cause the control focus to be lost, and they mess up Javascript customizations.  They suck.  Furthermore, if some controls require a postback to validate, and some don&#8217;t, the users will only get a partial validation at a time, which is annoying.  </p>
<p>Anyway, Microsoft thought the same thing of postbacks, and they provided an extension to these customvalidators that let you do the validation in Javascript.  So the only difficulty is, how do we retrieve the lookup&#8217;s value in Javascript?  It&#8217;s very easy if you know the client id, but ASP.NET has this nasty tendency to mangle those.  Not a big deal though, as JQuery is still able to find controls based on the last characters of the id (assuming there is no other control with that same id in the page).  This lets me write the following for validation:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">asp:CustomValidator</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ValidationGroup</span><span class="kwrd">="SubmitCredit"</span> <span class="attr">Text</span><span class="kwrd">="*"</span>
 <span class="attr">ErrorMessage</span><span class="kwrd">="Please select Purchasing Contact"</span>
 <span class="attr">ClientValidationFunction</span><span class="kwrd">="(function(s, e) { e.IsValid = !!$('input[id$=luePurchContact_LookupResult]').val(); })"</span> <span class="kwrd">/&gt;</span></pre>
<p>If you are suspicious about another lookup with the same id on another part of the page, use the following instead:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="frmAccCredit"</span><span class="kwrd">&gt;</span>
<span class="rem">&lt;!-- </span>
<span class="rem">  "frmAccCredit" would be a unique identifier for the form.</span>
<span class="rem">  You can use anything that is going to be unique, and put it at top level of the form.</span>
<span class="rem">  This is also handy for designing css rules that should not affect other</span>
<span class="rem">  parts of the page.</span>
<span class="rem">--&gt;</span>

...
more stuff
...

<span class="kwrd">&lt;</span><span class="html">asp:CustomValidator</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ValidationGroup</span><span class="kwrd">="SubmitCredit"</span> <span class="attr">Text</span><span class="kwrd">="*"</span>
 <span class="attr">ErrorMessage</span><span class="kwrd">="Please select Purchasing Contact"</span>
 <span class="attr">ClientValidationFunction</span><span class="kwrd">="(function(s, e) { e.IsValid = !!$('#frmAccCredit input[id$=luePurchContact_LookupResult]').val(); })"</span> <span class="kwrd">/&gt;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/03/08/validation-of-saleslogix-lookup-controls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compress database backups with Powershell</title>
		<link>http://blog.nicocrm.com/2010/01/18/compress-database-backups-with-powershell/</link>
		<comments>http://blog.nicocrm.com/2010/01/18/compress-database-backups-with-powershell/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 16:43:25 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=318</guid>
		<description><![CDATA[Disk space may be cheap but it is still not free!  And, while SQL Server 2008 supports online compression of backups, it is only available in the Enterprise edition.  So I wrote a simple powershell script (more like a snippet) to compress any backup (.bak and .trn files) older than 2 days.

cd E:\MSSQL\BACKUP\SalesLogix
dir [...]]]></description>
			<content:encoded><![CDATA[<p>Disk space may be cheap but it is still not free!  And, while SQL Server 2008 supports online compression of backups, it is only available in the Enterprise edition.  So I wrote a simple powershell script (more like a snippet) to compress any backup (.bak and .trn files) older than 2 days.</p>
<p><code><br />
cd E:\MSSQL\BACKUP\SalesLogix<br />
dir *.trn,*.bak | where { $_.CreationTime.CompareTo([DateTime]::Now.AddDays(-2)) -lt 0 } |% `<br />
	{ &#038; 'C:\Program Files\7-Zip\7z.exe' a "$_.zip" $_; rm $_ }<br />
</code></p>
<p>Could replace &#8220;.zip&#8221; with &#8220;.7z&#8221; to do a 7-zip compression &#8211; it will take a bit less disk space but more cpu.  Could also be tweaked a bit to support recursion.</p>
<p>I saved that to E:\MSSQL\Backup\ZipBackups.ps1 and created a schedule task to invoke &#8220;powershell E:\MSSQL\Backup\ZipBackups.ps1&#8243;.  This requires the execution policy to be set on powershell, to allow unsigned local scripts:</p>
<p><code><br />
set-executionpolicy RemoteSigned<br />
</code></p>
<p>I am still working on getting more familiar with powershell as it can be a nifty tool (and is becoming more and more standard on Windows servers as it is bundled with other packages)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/01/18/compress-database-backups-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More random errors.</title>
		<link>http://blog.nicocrm.com/2010/01/13/more-random-errors/</link>
		<comments>http://blog.nicocrm.com/2010/01/13/more-random-errors/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 22:38:07 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Saleslogix]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=312</guid>
		<description><![CDATA[A quick offering to the great Google god, in case you are running into the same issue:

&#8220;NullReferenceException&#8221; in the &#8220;ExtractValuesFromCell&#8221; method &#8211; this is caused by the &#8220;pseudo&#8221; cell added by the SlxGridView.  To work around, turn off the &#8220;ExpandableRows&#8221; flag.
Blank page with a NullReferenceException in the LookupControl ClientConfiguration.From method: check the provider listed [...]]]></description>
			<content:encoded><![CDATA[<p>A quick offering to the great Google god, in case you are running into the same issue:</p>
<ul>
<li>&#8220;NullReferenceException&#8221; in the &#8220;ExtractValuesFromCell&#8221; method &#8211; this is caused by the &#8220;pseudo&#8221; cell added by the SlxGridView.  To work around, turn off the &#8220;ExpandableRows&#8221; flag.</li>
<li>Blank page with a NullReferenceException in the LookupControl ClientConfiguration.From method: check the provider listed in connection.config.  It needs to be spelled &#8220;SLXOLEDB&#8221;.  If it is spelled out &#8220;SalesLogix OLEDB Connection Provider&#8221;, it will fail (not sure why but on 7.5.2 sometimes the connection is output in that format &#8211; I think, because I created the connection in AA, instead of logging into the Admin first)</li>
<li>Web client crashes when grid.Sort is called &#8211; do not call that method from the Sorting handler because it will cause infinite recursion (the Sorting handler can often be empty)</li>
<li>AA gives ArgumentNullException when Update Properties is clicked: this is an installation problem.  Run a repair.  In fact, if you get random errors from AA, and they are not specific to one project, running a repair should probably be the first corrective action.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/01/13/more-random-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Direct SQL in Web Grids</title>
		<link>http://blog.nicocrm.com/2010/01/08/using-direct-sql-in-web-grids/</link>
		<comments>http://blog.nicocrm.com/2010/01/08/using-direct-sql-in-web-grids/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 21:08:27 +0000</pubDate>
		<dc:creator>Nicolas Galler</dc:creator>
				<category><![CDATA[Saleslogix]]></category>

		<guid isPermaLink="false">http://blog.nicocrm.com/?p=305</guid>
		<description><![CDATA[Another (thankfully smaller) post on the SalesLogix journal, detailing how to use straight SQL in a web grid.  I use that a lot when I have a complex, read-only query (so much faster than cranking out the corresponding C# code to do it through the entity model), and I know a lot of SalesLogix [...]]]></description>
			<content:encoded><![CDATA[<p>Another (thankfully smaller) post on the SalesLogix journal, detailing how to use straight SQL in a web grid.  I use that a lot when I have a complex, read-only query (so much faster than cranking out the corresponding C# code to do it through the entity model), and I know a lot of SalesLogix dev are <b>very</b> familiar with SQL, so figured it would be useful.</p>
<p>The article is at <a href="http://community.sagesaleslogix.com/t5/The-Sage-SalesLogix-Journal/Back-to-Basics-Using-Direct-SQL-in-Web-Grids-Guest-Blog-by-Nick/ba-p/8045">Back to Basics &#8211; Using Direct SQL in Web Grids</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nicocrm.com/2010/01/08/using-direct-sql-in-web-grids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
