<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Alec Pojidaev&#039;s Blog</title>
	<atom:link href="http://alecpojidaev.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://alecpojidaev.wordpress.com</link>
	<description>Stuff published for no reason (cool codeless infopath solutions mostly)</description>
	<lastBuildDate>Fri, 06 Nov 2009 19:59:01 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='alecpojidaev.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/b3d702a4a20f1087e81c9f261e03bda1?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Alec Pojidaev&#039;s Blog</title>
		<link>http://alecpojidaev.wordpress.com</link>
	</image>
			<item>
		<title>Work (business) days calculations with C#</title>
		<link>http://alecpojidaev.wordpress.com/2009/10/29/work-days-calculation-with-c/</link>
		<comments>http://alecpojidaev.wordpress.com/2009/10/29/work-days-calculation-with-c/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 20:34:54 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[business days]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[weekdays]]></category>
		<category><![CDATA[work days]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=371</guid>
		<description><![CDATA[If you think it&#8217;s a decent solution vote for it! :)
 
Work days between 2 dates:
DateTime startDate = new DateTime(2000, 5, 28);
DateTime endDate = new DateTime(2009, 3, 22);
double calcBusinessDays =
1 + ((endDate &#8211; startDate).TotalDays * 5
- (startDate.DayOfWeek &#8211; endDate.DayOfWeek) * 2) / 7;
if ((int)endDate.DayOfWeek == 6) calcBusinessDays --;
if ((int)startDate.DayOfWeek == 0) calcBusinessDays --;
 


Add work days to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=371&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you think it&#8217;s a decent solution <a href="http://stackoverflow.com/questions/1617049/calculate-the-number-of-business-days-between-two-dates/1646396#1646396" target="_blank">vote for it! </a>:)</p>
<p class="MsoNormal" style="line-height:normal;margin-bottom:0;"> </p>
<p class="MsoNormal" style="line-height:normal;margin-bottom:0;"><strong>Work days between 2 dates:</strong></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="color:#2b91af;">DateTime</span> startDate = <span style="color:blue;">new</span> <span style="color:#2b91af;">DateTime</span>(2000, 5, 28);</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="color:#2b91af;">DateTime</span> endDate = <span style="color:blue;">new</span> <span style="color:#2b91af;">DateTime</span>(2009, 3, 22);</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="color:blue;">double</span> calcBusinessDays =</p>
<p class="MsoNormal" style="padding-left:30px;">1 + ((endDate &#8211; startDate).TotalDays * 5</p>
<p class="MsoNormal" style="padding-left:30px;">- (startDate.DayOfWeek &#8211; endDate.DayOfWeek) * 2) / 7;</p>
<p class="MsoNormal"><span style="color:#0000ff;"><span style="color:#0000ff;">if</span></span> ((<span style="color:#0000ff;"><span style="color:#0000ff;">int</span></span>)endDate.DayOfWeek == 6) calcBusinessDays <span>-</span>-;</p>
<p class="MsoNormal"><span style="color:#0000ff;"><span style="color:#0000ff;">if</span></span> ((<span style="color:#0000ff;"><span style="color:#0000ff;">int</span></span>)startDate.DayOfWeek == 0) calcBusinessDays <span>-</span>-;</p>
<p class="MsoNormal" style="line-height:normal;padding-left:30px;margin-bottom:0;"> </p>
<p class="MsoNormal" style="line-height:normal;padding-left:30px;margin-bottom:0;">
<p class="MsoNormal" style="line-height:normal;padding-left:30px;margin-bottom:0;">
<p class="MsoNormal" style="line-height:normal;margin-bottom:0;"><strong>Add work days to a start date:</strong></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="color:#2b91af;">DateTime</span> startDate = <span style="color:blue;">new</span> <span style="color:#2b91af;">DateTime</span>(2000, 5, 28);</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="color:blue;">double </span>businessDays = 2300;</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="color:blue;">int </span>DoW = (<span style="color:blue;">int</span>)startDate.DayOfWeek;</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="color:blue;">double </span>temp = businessDays + DoW ;</p>
<p class="MsoNormal" style="line-height:normal;margin-bottom:0;"><span style="color:#0000ff;"><span style="color:#0000ff;">if</span></span> (DoW != 0) temp <span>-</span>-;</p>
<p class="MsoNormal" style="line-height:normal;margin-bottom:0;"><span style="color:#2b91af;">DateTime </span>calcEndDate = startDate.AddDays(</p>
<p class="MsoNormal" style="line-height:normal;padding-left:30px;margin-bottom:0;"><span style="color:#2b91af;">Math</span>.Floor(temp / 5)*2 &#8211; DoW + temp</p>
<p class="MsoNormal" style="padding-left:30px;">- 2* <span style="color:#2b91af;">Convert</span>.ToInt32(temp % 5 == 0)) ;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/371/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/371/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/371/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=371&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2009/10/29/work-days-calculation-with-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>
	</item>
		<item>
		<title>How to remove initial row in repeating tables (or delete all rows) with rules only</title>
		<link>http://alecpojidaev.wordpress.com/2009/09/10/how-to-remove-initial-row-in-repeating-tables/</link>
		<comments>http://alecpojidaev.wordpress.com/2009/09/10/how-to-remove-initial-row-in-repeating-tables/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 14:34:44 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[XPath]]></category>
		<category><![CDATA[browser forms]]></category>
		<category><![CDATA[browser-enabled]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[formulas]]></category>
		<category><![CDATA[repeating table]]></category>
		<category><![CDATA[Rules]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=284</guid>
		<description><![CDATA[Bookmark that post
Special thanks: Karl D. Swartzendruber
 Form to test. Web browser forms OK.
First of all you have to place your repeating group into the non repeating one. So your field structure should be looking like that:
Then as you can see the simple rule f=cleaningGroup will delete all rows. Now we are getting to the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=284&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://delicious.com/save?url=http%3A%2F%2Falecpojidaev.wordpress.com%2F2009%2F09%2F10%2Fhow-to-remove-initial-row-in-repeating-tables%2F&amp;title=How%20to%20remove%20initial%20row%20in%20repeating%20tables%20%28or%20delete%20all%20rows%29%20with%20rules%20only&amp;jump=%2Ftag%2Finfopath&amp;key=lrHycjxVqTdfQlPTFFSAUVpWqn4-&amp;original_user=alecpojidaev">Bookmark that post</a></p>
<p><span style="font-family:Helv;">Special thanks: Karl D. Swartzendruber</span></p>
<p> <a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/NofirstRow.xsn">Form</a> to test. Web browser forms OK.</p>
<p>First of all you have to place your repeating group into the non repeating one. So your field structure should be looking like that:</p>
<div id="attachment_301" class="wp-caption alignleft" style="width: 241px"><img src="http://alecpojidaev.files.wordpress.com/2009/09/delfrow.jpg?w=231&#038;h=244" alt="Field structure" title="DelFRow" width="231" height="244" class="size-full wp-image-301" /><p class="wp-caption-text">Field structure</p></div>
<p>Then as you can see the simple rule f=cleaningGroup will delete all rows. Now we are getting to the point why it never been implemented before. As soon as  you will try to assign any value to a group InfoPath will yell at you with the message: &#8220;You must select a field. Groups do not have values and therefore cannot be assigned to by this action.&#8221; Let&#8217;s prove that at least &#8220;cannot be assigned&#8221; part of that statement is false.</p>
<p>It&#8217;s time for some rule breaking.</p>
<p>Now we will screw up the group (&#8220;f&#8221; in our case) by giving it a temporary name. Create a field at the same level as your group formerly named &#8220;f&#8221;. Name that field &#8230; guess what?  Right, with the name &#8220;f&#8221;. Now InfoPath UI won&#8217;t be objecting when you&#8217;ll try to create button rule f=cleaningGroup.  Delete field &#8220;f&#8221;. Rename your group back to its original name: &#8220;f&#8221;.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=284&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2009/09/10/how-to-remove-initial-row-in-repeating-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2009/09/delfrow.jpg" medium="image">
			<media:title type="html">DelFRow</media:title>
		</media:content>
	</item>
		<item>
		<title>A mutually exclusive check box (radio button) in a repeating section</title>
		<link>http://alecpojidaev.wordpress.com/2009/08/26/a-mutually-exclusive-check-box-in-a-repeating-section/</link>
		<comments>http://alecpojidaev.wordpress.com/2009/08/26/a-mutually-exclusive-check-box-in-a-repeating-section/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:24:58 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[XPath]]></category>
		<category><![CDATA[browser forms]]></category>
		<category><![CDATA[browser-enabled]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[check box]]></category>
		<category><![CDATA[formulas]]></category>
		<category><![CDATA[radio button]]></category>
		<category><![CDATA[repeating]]></category>
		<category><![CDATA[Rules]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=271</guid>
		<description><![CDATA[Bookmark that post
Clean XPath only solution. Browser forms OK.
The FORM to try.
Create following field/group structure:

Assign 0 as initial value to rStarter field. Assign following XPath expression as inital value to the ChBx field:
(../my:rStarter = xdMath:Max(../../my:CheckG/my:rStarter)) and (../my:rStarter != 0)
Create rule at ChBx field.
 This rule has 2 actions: 

Assign rStarter to 2 * (. != [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=271&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://delicious.com/save?url=http%3A%2F%2Falecpojidaev.wordpress.com%2F2009%2F08%2F26%2Fa-mutually-exclusive-check-box-in-a-repeating-section%2F&amp;title=A%20mutually%20exclusive%20check%20box%20%28radio%20button%29%20in%20a%20repeating%20section&amp;jump=%2Ftag%2Finfopath&amp;key=lrHycjxVqTdfQlPTFFSAUVpWqn4-&amp;original_user=alecpojidaev">Bookmark that post</a></p>
<p>Clean XPath only solution. Browser forms OK.<br />
The <a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/ExclusiveCheckbox.xsn">FORM</a> to try.</p>
<p>Create following field/group structure:</p>
<p><img src="http://alecpojidaev.files.wordpress.com/2009/08/exchbox.jpg?w=214&#038;h=126" alt="fields" title="ExChBox" width="214" height="126" class="size-full wp-image-306" /><br />
Assign 0 as initial value to rStarter field. Assign following XPath expression as inital value to the ChBx field:</p>
<p><span style="color:#ce9d84;">(../my:rStarter = xdMath:Max(../../my:CheckG/my:rStarter)) and (../my:rStarter != 0)</span></p>
<p>Create rule at ChBx field.<br />
 This rule has 2 actions: </p>
<ul>
<li>Assign rStarter to <span style="color:#ce9d84;">2 * (. != &#8220;false&#8221;)</span> </li>
<li>Assign rStarter to <span style="color:#ce9d84;">1 * (. != &#8220;false&#8221;)</span> </li>
</ul>
<p>Place control you like (check box or radio button) on the layout. For check box default  &#8220;Value when cleared&#8221; to false and &#8220;Value when checked&#8221; to true. For radio button limit amount of choices to 1 and set &#8220;Value when selected&#8221; to true.</p>
<p>Thats it. Happy codeless programming!</p>
<p>P.S. Actually that form looks as potentially a good example to demonstrate field updating concepts like &#8220;push&#8221; and &#8220;pull&#8221; and how they are interrelate with each other. In particulary it would be interesting to explain why the sequence of operators like i=2; i=1; which have no sense in any language can be useful thing in Infopath. (Kind of a statement, eh? My only hope here is that people familiar with volatile variables concept and multithreading are not reading posts about InfoPath) </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/271/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=271&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2009/08/26/a-mutually-exclusive-check-box-in-a-repeating-section/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2009/08/exchbox.jpg" medium="image">
			<media:title type="html">ExChBox</media:title>
		</media:content>
	</item>
		<item>
		<title>How to check if your InfoPath form is &#8220;dirty&#8221;?</title>
		<link>http://alecpojidaev.wordpress.com/2009/07/06/how-to-check-if-your-form-is-dirty/</link>
		<comments>http://alecpojidaev.wordpress.com/2009/07/06/how-to-check-if-your-form-is-dirty/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 21:00:59 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[XPath]]></category>
		<category><![CDATA[browser forms]]></category>
		<category><![CDATA[browser-enabled]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[expression box]]></category>
		<category><![CDATA[formulas]]></category>
		<category><![CDATA[Rules]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=236</guid>
		<description><![CDATA[Bookmark that post
1) Create field called InitialState
2) At open event assign InitialState field to the following Xpath expression:
.. Yes, it&#8217;s two dots :)
3)  At the submit rule compare InitialState field with the following expression assuming it&#8217;s a rule condition at a button:
starts-with(., my:InitialState)
Make sure the InitialState field is a very last node in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=236&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://delicious.com/save?url=http%3A%2F%2Falecpojidaev.wordpress.com%2F2009%2F07%2F06%2Fhow-to-check-if-your-form-is-dirty%2F&amp;title=How%20to%20check%20if%20your%20InfoPath%20form%20is%20%22dirty%22%3F&amp;jump=%2Ftag%2Finfopath&amp;key=lrHycjxVqTdfQlPTFFSAUVpWqn4-&amp;original_user=alecpojidaev">Bookmark that post</a></p>
<p>1) Create field called InitialState<br />
2) At open event assign InitialState field to the following Xpath expression:</p>
<p><span style="color:#ce9d84;">..</span> Yes, it&#8217;s two dots :)</p>
<p>3)  At the submit rule compare InitialState field with the following expression assuming it&#8217;s a rule condition at a button:<br />
<span style="color:#ce9d84;">starts-with(., my:InitialState)</span><br />
Make sure the InitialState field is a very last node in the myFields group fields list.<br />
I also believe some people might find interesting the way I used conditional expression to parameterize output message.</p>
<p><a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/IsDirty.xsn">Here is form to test</a></p>
<p><a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/IsDirty2.xsn">Form </a>with more advanced XPath (InitialState can be at any position)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/236/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=236&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2009/07/06/how-to-check-if-your-form-is-dirty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>
	</item>
		<item>
		<title>Infopath codeless programming (walkthrough) 3</title>
		<link>http://alecpojidaev.wordpress.com/2009/06/18/infopath-codeless-programming-walkthrough-3/</link>
		<comments>http://alecpojidaev.wordpress.com/2009/06/18/infopath-codeless-programming-walkthrough-3/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 18:48:40 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[XPath]]></category>
		<category><![CDATA[browser forms]]></category>
		<category><![CDATA[browser-enabled]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[formulas]]></category>
		<category><![CDATA[Rules]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=213</guid>
		<description><![CDATA[Other parts: 1, 2.
Bookmark that post
I hope this will be the last publication about codeless programming in InfoPath. In the first two parts I demonstrated few examples where we can see implementations of &#8216;while&#8217; and &#8216;if&#8217; like operators. The only area remained uncovered is block of code reusable by multiple controls (analog of procedure/function). Hopefully [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=213&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Other parts: <a href="http://alecpojidaev.wordpress.com/2008/12/16/infopath-codeless-programming-walkthrough/">1</a>, <a href="http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/">2</a>.<br />
<a href="http://delicious.com/save?url=http%3A%2F%2Falecpojidaev.wordpress.com%2F2009%2F06%2F18%2Finfopath-codeless-programming-walkthrough-3%2F&amp;title=Infopath%20codeless%20programming%20%28walkthrough%29%203%20%C2%AB%20Alec%20Pojidaev%E2%80%99s%20Blog&amp;jump=%2Fsearch%3Fp%3Dpojidaev%26chk%3D%26context%3Drecent%257C%257Cinfopath%26fr%3Ddel_icio_us%26lc%3D&amp;key=lrHycjxVqTdfQlPTFFSAUVpWqn4-&amp;original_user=derekgo">Bookmark that post</a></p>
<p>I hope this will be the last publication about codeless programming in InfoPath. In the first two parts I demonstrated few examples where we can see implementations of &#8216;while&#8217; and &#8216;if&#8217; like operators. The only area remained uncovered is block of code reusable by multiple controls (analog of procedure/function). Hopefully that approach will be able to address quite frequent complains about absence of ability to copy set of actions/rules across similar controls in InfoPath UI. The essential element of that approach is hidden field with shared set of actions/rules. <a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/CodeBlockDemo.xsn">Form to download</a></p>
<p>Happy codeless programming!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=213&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2009/06/18/infopath-codeless-programming-walkthrough-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>
	</item>
		<item>
		<title>Most underused/unknown SharePoint feature</title>
		<link>http://alecpojidaev.wordpress.com/2009/04/13/most-undereusedunknown-sharepoint-feature/</link>
		<comments>http://alecpojidaev.wordpress.com/2009/04/13/most-undereusedunknown-sharepoint-feature/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 14:50:24 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=199</guid>
		<description><![CDATA[You can tag any element on your portal with the comment. The comment becomes visible for everybody who are at the same page and have Discussion tollbar open. It works as instant messaging too. 
When you are at any page of your portal go to the IE explorer menu bar Vew-&#62;Explorer Bars-&#62;Discuss. 
Use the button [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=199&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>You can tag any element on your portal with the comment. The comment becomes visible for everybody who are at the same page and have Discussion tollbar open. It works as instant messaging too. </p>
<p>When you are at any page of your portal go to the IE explorer menu bar Vew-&gt;Explorer Bars-&gt;Discuss. </p>
<p>Use the button &#8220;Insert Discussion in the Document&#8221;. The server will highligt all places on the page you could tag with a comment.</p>
<p>Type in your comment.</p>
<p>That feature is available because Office Server Extentions are part of Sharepoint installation.</p>
<p><a href="http://blogs.msdn.com/sharepoint/archive/2007/12/27/sharepoint-yes-we-ve-certainly-come-a-long-way-and-happy-new-year-to-you.aspx">Link</a> about Office Server Extentions and thier relation to SharePoint.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=199&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2009/04/13/most-undereusedunknown-sharepoint-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiple merge views in InfoPath form library</title>
		<link>http://alecpojidaev.wordpress.com/2009/02/11/multiple-merge-views-in-infopath-form-library/</link>
		<comments>http://alecpojidaev.wordpress.com/2009/02/11/multiple-merge-views-in-infopath-form-library/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 22:57:59 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[merge]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=152</guid>
		<description><![CDATA[There is no out of the box way how to create custom view which supports merge functionality. But such minor obstacles shouldn&#8217;t stop you from creating as many merge views in your library as you want. 
1) Click &#8220;Create new view&#8221; link in your form library
2) Navigate to the &#8220;Start from an existing view&#8221; section [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=152&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There is no out of the box way how to create custom view which supports merge functionality. But such minor obstacles shouldn&#8217;t stop you from creating as many merge views in your library as you want. </p>
<p>1) Click &#8220;Create new view&#8221; link in your form library<br />
2) Navigate to the &#8220;Start from an existing view&#8221; section (and we going to do so to not just one more time to ensure that merge view is not presented among proposed choices)<br />
3) Right click on any of the choices and copy shortcut to clipboard<br />
4) Open NotePad (or any other editor) and paste<br />
5) Open existing merge view and click &#8220;Modify this view&#8221; link<br />
6) Copy part of the hyperlink in your browser which is in between &#8216;View=%7B&#8217; and &#8216;%7D&amp;Source&#8217;<br />
7) In NotePad replace part from &#8216;View=&#8217; to the end with information from your clipboard<br />
8) Copy resulting link into addres bar of the new browser window and press &#8220;go to&#8221; button.<br />
9) Enjoy your new and shiny merge supporting view :)</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=152&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2009/02/11/multiple-merge-views-in-infopath-form-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>
	</item>
		<item>
		<title>Infopath codeless programming (walkthrough) 2</title>
		<link>http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/</link>
		<comments>http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 17:33:06 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[Date Picker Control]]></category>
		<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[XPath]]></category>
		<category><![CDATA[browser forms]]></category>
		<category><![CDATA[browser-enabled]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[business days]]></category>
		<category><![CDATA[date calculations]]></category>
		<category><![CDATA[Date Picker]]></category>
		<category><![CDATA[formulas]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[Rules]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[weekdays]]></category>
		<category><![CDATA[work days]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=105</guid>
		<description><![CDATA[Other parts: 1, 3.
Bookmark that post
Updated: 3 more forms added at the bottom: &#8220;work days calculation (excluding weekends and holidays)&#8221;, &#8220;day of the week calculation&#8221; and &#8220;Days since form was created&#8221;.
Special thanks: Karl D. Swartzendruber
So what about so called &#8220;codeless programming&#8221; in InfoPath? As we all probably know, InfoPath can performed only 16 calulations without [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=105&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Other parts: <a href="http://alecpojidaev.wordpress.com/2008/12/16/infopath-codeless-programming-walkthrough/">1</a>, <a href="http://alecpojidaev.wordpress.com/2009/06/18/infopath-codeless-programming-walkthrough-3/">3</a>.<br />
<a href="http://delicious.com/save?url=http%3A%2F%2Falecpojidaev.wordpress.com%2F2008%2F12%2F30%2Finfopath-codeless-programming-walkthrough-2%2F&amp;title=Infopath%20codeless%20programming%20%28walkthrough%29%202%20%C2%AB%20Alec%20Pojidaev%27s%20Blog&amp;jump=%2Ftag%2Finfopath&amp;key=lrHycjxVqTdfQlPTFFSAUVpWqn4-&amp;original_user=toddvalorem">Bookmark that post</a></p>
<p>Updated: 3 more forms added at the bottom: &#8220;work days calculation (excluding weekends and holidays)&#8221;, &#8220;day of the week calculation&#8221; and &#8220;Days since form was created&#8221;.</p>
<p><span style="font-family:Helv;">Special thanks: Karl D. Swartzendruber</span></p>
<p style="font-family:Arial;margin:5px;">So what about so called &#8220;codeless programming&#8221; in InfoPath? As we all probably know, InfoPath can performed only 16 calulations without user interaction. But what if your business rules require you to iterate through 17 repeating elements? You will get a message box from InfoPath with phrase &#8220;The rules or code may be causing an infinite loop&#8221;. Yes, in InfoPath 16 is a very big number and 17 is considered infinite. To you and I this might seem stupid and arbitrarily restrictive, but Microsoft&#8217;s wisdom is greater than ours. Perhaps they know that 17th iteration would give us developers too much power. It would break the fine balance of Microsoft applications, make other development tools obsolete, and become unbearable for non InfoPath developers. But let&#8217;s drop the light irony and just accept that InfoPath already has more codeless programming power than mere mortals should ever need.</p>
<p>Today&#8217;s challenge is to find the difference in days between 2 datepicker controls disregarding the absence of datediff() function in InfoPath. We are going to show that the 16 iterations limit just can&#8217;t stop the true codeless programmer.</p>
<p>Disclaimer: During developing cycle author has been having in mind &#8220;finite automates&#8221; principles as well as primitive binary search.</p>
<p>Anyway, lets get to the business. Date Difference Calculation. <a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/dateCheck.xsn">Form to download.</a></p>
<p>Our recipy is the following: We will need 3 fields. 2 of them are date type fields with datepicker controls (startDate, endDate) and one (dayDifference) is a text type field represented by a simple textbox. All rules have exactly 1 action.</p>
<p>startDate rule:</p>
<p style="padding-left:30px;">condition expession: <span style="color:#ce9d84;">../my:endDate != &quot;&quot;</span><br />
field: dayDifference<br />
string value: 0;4096</p>
<p>endDate rule:</p>
<p style="padding-left:30px;">condition expession: <span style="color:#ce9d84;">../my:startDate != &quot;&quot;</span><br />
field: dayDifference<br />
string value: 0;4096</p>
<p>dayDifference rules:</p>
<p style="padding-left:30px;">MainRule:</p>
<p style="padding-left:60px;">condition expession: <span style="color:#ce9d84;"><br />
xdDate:AddDays(../my:startDate, substring-before(., &quot;;&quot;)) != ../my:endDate and contains(., &quot;;&quot;)</span><br />
field: dayDifference<br />
xPath expression: <span style="color:#ce9d84;">concat(substring-before(., &quot;;&quot;) + substring-after(., &quot;;&quot;) * ((translate(xdDate:AddDays(../my:startDate, substring-before(., &quot;;&quot;)), &quot;-&quot;, &quot;&quot;) &lt; translate(../my:endDate, &quot;-&quot;, &quot;&quot;)) * 2 &#8211; 1), &quot;;&quot;, substring-after(., &quot;;&quot;) div 2)</span></p>
<p style="padding-left:30px;">finalize rule:</p>
<p style="padding-left:60px;">condition expession: <span style="color:#ce9d84;">contains(., &quot;;&quot;)</span><br />
field: dayDifference<br />
xPath expression: <span style="color:#ce9d84;">substring-before(., &quot;;&quot;)</span></p>
<p><span style="font-family:Helv;"><img class="alignnone size-full wp-image-108" title="second" src="http://alecpojidaev.files.wordpress.com/2008/12/second.png?w=436&#038;h=148" alt="second" width="436" height="148" /></span></p>
<p>Your form is ready!</p>
<h3><strong><span style="color:#0000ff;">What else can be done by applying same principles:</span></strong></h3>
<p><a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/DaysSinceCreated.xsn">Here is form</a> that shows amount of days since it was created<br />
<a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/WhatDayIsToday.xsn">Form</a> that shows current day of the week and day of the week from Date Picker control.<br />
The tricky one: <a href="http://cid-e5a123fca40349ad.skydrive.live.com/self.aspx/.Public/WorkDaysCalc.xsn">Work days calculation (business days)</a>  </p>
<p>That&#8217;s it. Happy codeless programming!<br />
</br> </br></br> </br></p>
<p>Posted under tags: Infopath, Date Picker Control</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=105&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/feed/</wfw:commentRss>
		<slash:comments>90</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2008/12/second.png" medium="image">
			<media:title type="html">second</media:title>
		</media:content>
	</item>
		<item>
		<title>Infopath codeless programming (walkthrough) 1</title>
		<link>http://alecpojidaev.wordpress.com/2008/12/16/infopath-codeless-programming-walkthrough/</link>
		<comments>http://alecpojidaev.wordpress.com/2008/12/16/infopath-codeless-programming-walkthrough/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 18:35:57 +0000</pubDate>
		<dc:creator>alecpojidaev</dc:creator>
				<category><![CDATA[Contact Selector]]></category>
		<category><![CDATA[Contact Selector Control]]></category>
		<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[UserProfileService]]></category>
		<category><![CDATA[XPath]]></category>
		<category><![CDATA[browser forms]]></category>
		<category><![CDATA[browser-enabled]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[eval]]></category>
		<category><![CDATA[data connections]]></category>
		<category><![CDATA[formulas]]></category>
		<category><![CDATA[people picker]]></category>
		<category><![CDATA[repeating]]></category>
		<category><![CDATA[Rules]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[username]]></category>

		<guid isPermaLink="false">http://alecpojidaev.wordpress.com/?p=3</guid>
		<description><![CDATA[Posted under tags: Contact Selector Control Infopath Sharepoint<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=3&subd=alecpojidaev&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="font-family:Helv;">Special thanks: Karl D. Swartzendruber and all participants of following discussion:</span><br />
<span style="font-family:Helv;"><a href="http://www.infopathdev.com/forums/p/10098/35969.aspx#35969">http://www.infopathdev.com/forums/p/10098/35969.aspx#35969</a></span></p>
<p>Other parts: <a href="http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/">2</a>, <a href="http://alecpojidaev.wordpress.com/2009/06/18/infopath-codeless-programming-walkthrough-3/">3</a>.<br />
<a href="http://delicious.com/save?url=http%3A%2F%2Falecpojidaev.wordpress.com%2F2008%2F12%2F16%2Finfopath-codeless-programming-walkthrough%2F&amp;title=Infopath%20codeless%20programming%20%28walkthrough%29%20%C2%AB%20Alec%20Pojidaev%E2%80%99s%20Blog&amp;jump=%2Fsearch%3Fp%3Dpojidaev%26chk%3D%26context%3Drecent%257C%257Cinfopath%26fr%3Ddel_icio_us%26lc%3D&amp;key=lrHycjxVqTdfQlPTFFSAUVpWqn4-&amp;original_user=rramhap">Bookmark that post</a></p>
<p style="font-family:Arial;margin:5px;">Let me guess what might have brought you to that blog page about codeless programming in InfoPath. Any of you who developed at least one sophisticated InfoPath form sooner or later have been realized that writing forms with real complex behavior is impossible without some sort of coding in C# or VB.NET. So developers have no choice but to deal with mixed developing environment like Visual Studio, managing form security levels, security certificates and so on. But there are people who like to keep things simple. At least I do. And that&#8217;s why probably you are reading that page too:)</p>
<p>Anyway, lets get to the business. How to iterate an Infopath Repeating table?</p>
<p>Here is our scenario: we have a repeating group on the form which will be populated with wonderful (but often overlooked) Contact Selector Control with some user information. The control provides us all necessary information about user except his email.</p>
<p>But wait, that is outrageous! The email was the only reason why we decided to use that now not so awesome control! Well&#8230; at least we have access to the web service which able to return user email in exchange of account name. There are countless blogs describing how to utilize UserProfileService to get info of a single user in Contact Selector. Here I&#8217;ll try to demonstrate how to deal with multiple selection in Contact Selector. So now our task is clear &#8211; we have to construct a string acceptable in Email address field iterating through repeating group and submitting query to the web service on each cycle of iteration.</p>
<p>Let&#8217;s go.</p>
<p>The first things first &#8211; here <a title="using-the-contact-selector-control" href="http://blogs.msdn.com/infopath/archive/2007/02/28/using-the-contact-selector-control.aspx" target="_blank">using-the-contact-selector-control</a> you will find detailed explanation how to utilize Contact Selector Control. The resulting data structure for the control in main data source should look like this<br />
<img title="cscontrol" src="http://alecpojidaev.files.wordpress.com/2008/12/cscontrol.png?w=345&#038;h=91" alt="cscontrol" width="345" height="91" /></p>
<p style="font-family:Arial;margin:5px;">The Control also requires secondary data source<br />
<img class="alignnone" title="contexts" src="http://alecpojidaev.files.wordpress.com/2008/12/contexts.png?w=220&#038;h=88" alt="" width="220" height="88" /></p>
<p>Add text field named HlinkToEmail. That field will hold result of our computations. Resulting Main Data Source:</p>
<p><img class="size-full wp-image-83" title="mainds" src="http://alecpojidaev.files.wordpress.com/2008/12/mainds1.png" alt="MainDS" /></p>
<p>When your new shiny control starts providing you users from your network that means we are ready for the web service part. Here we&#8217;ll use SharePoint GetUserProfileByName web method. You will need SharePoint Services running somewhere on your network. That part is pretty straightforward. Add secondary web service receive connection. Your link in connection settings should look like</p>
<p>http://&lt;youservername&gt;/_vti_bin/UserProfileService.asmx.</p>
<p>The results of that part:</p>
<p><img class="alignnone" title="upros" src="http://alecpojidaev.files.wordpress.com/2008/12/upros.png" alt="" width="317" height="328" /></p>
<p><span style="color:#0000ff;">&#8220;Programming&#8221; part</span></p>
<p>Place a button on the layout. At Rules and Merge tab create rule named setfCounter. Press &#8220;Set Conditon&#8221;. In the first area choose &#8220;The expression&#8221;. Here is string to paste in second area:</p>
<p><span style="color:#ce9d84;">count(my:Person)&gt;0</span></p>
<p>The only action will assign initial value to the HlinkToEmail field. Press fx button at new action form. Check &#8220;Edit XPath (advanced)&#8221; checkbox. To avoid too detailed instructions of choosing functions and form elements just copy paste the following expression:</p>
<p><span style="color:#ce9d84;">xdMath:Eval(xdMath:Eval(my:Person, &#8216;concat(my:AccountId, &quot;|&quot;)&#8217;), &quot;..&quot;) </span></p>
<p><span style="font-family:Helv;"><span style="font-family:Helv;"><img class="alignnone size-full wp-image-50" title="crule2" src="http://alecpojidaev.files.wordpress.com/2008/12/crule3.png" alt="crule2" /></span></span></p>
<p>At main data source pane double click at HlinkToEmail field. At Rules and Merge tab create rule named fConterRule. It&#8217;s a conditional rule. In the Set Condition dialog in the first area: Choose The expression. Then paste this expression into second area:</p>
<p><span style="color:#ce9d84;">contains(., &quot;|&quot;)</span></p>
<p>The resulting set of actions:</p>
<p><span style="font-family:Helv;"><span style="font-family:Helv;"><img class="alignnone size-full wp-image-52" title="actions12" src="http://alecpojidaev.files.wordpress.com/2008/12/actions12.png" alt="actions12" width="438" height="334" /></span></span></p>
<p>The rule will consist of 3 actions. The fist action will be setting AccountName field of data source named GetUserProfileByName to the portion of HlinkToEmail field. Check &#8220;Edit XPath (advanced)&#8221; checkbox. Paste Xpath expression:</p>
<p><span style="color:#ce9d84;">substring-before(., &quot;|&quot;)</span></p>
<p>Next is self-explanatory action. Add action -&gt; Query using data connection -&gt; Choose GetUserProfileByName.</p>
<p>Add the last action to set HlinkToEmail field to the new value by assigning following XPath expression:</p>
<p><span style="color:#ce9d84;">concat(substring-after(., &quot;|&quot;), &quot;;&quot;, xdXDocument:GetDOM(&quot;GetUserProfileByName&quot;)/dfs:myFields/dfs:dataFields/s0:GetUserProfileByNameResponse/s0:GetUserProfileByNameResult/s0:PropertyData/s0:Values/s0:ValueData/s0:Value[../../../s0:Name = &quot;WorkEmail&quot;])</span></p>
<p>We done with actions of that rule. Make sure that check box &#8220;Stop processing rules then this rule finishes&#8221; is checked.</p>
<p>Add the last rule right after fConterRule. In Set Condition dialog choose The expression. In expression area copy paste:</p>
<p><span style="color:#ce9d84;">substring-before(., &quot;;&quot;) = &quot;&quot; and contains(.,&quot;;&quot;)</span></p>
<p><span style="font-family:Helv;"><img class="alignnone size-full wp-image-51" title="lastaction1" src="http://alecpojidaev.files.wordpress.com/2008/12/lastaction2.png" alt="lastaction2" width="438" height="333" /></span></p>
<p>And finally, set the HlinkToEmail to the following XPath expression:</p>
<p><span style="color:#ce9d84;">substring-after(., &quot;;&quot;)</span></p>
<p>That&#8217;s it.</p>
<p>P.S. Now you know how to iterate and read repeating structures. But what if you need to write? Well, InfoPath doesn’t provide UI to parameterize repeating structures are assigned to new values. Still <a title="Referencing" href="http://www.infopathdev.com/forums/t/9316.aspx" target="_blank">here</a> you will find a workaround which overcomes this limitation.</p>
<p>Posted under tags: MOSS Contact Selector Control Infopath Sharepoint</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alecpojidaev.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alecpojidaev.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alecpojidaev.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alecpojidaev.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alecpojidaev.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alecpojidaev.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alecpojidaev.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alecpojidaev.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alecpojidaev.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alecpojidaev.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alecpojidaev.wordpress.com&blog=5861605&post=3&subd=alecpojidaev&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alecpojidaev.wordpress.com/2008/12/16/infopath-codeless-programming-walkthrough/feed/</wfw:commentRss>
		<slash:comments>84</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c355f9ed5dad73446e220dae41f85a11?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">alecpojidaev</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2008/12/cscontrol.png" medium="image">
			<media:title type="html">cscontrol</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2008/12/contexts.png" medium="image">
			<media:title type="html">contexts</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2008/12/mainds1.png" medium="image">
			<media:title type="html">mainds</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2008/12/upros.png" medium="image">
			<media:title type="html">upros</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2008/12/crule3.png" medium="image">
			<media:title type="html">crule2</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2008/12/actions12.png" medium="image">
			<media:title type="html">actions12</media:title>
		</media:content>

		<media:content url="http://alecpojidaev.files.wordpress.com/2008/12/lastaction2.png" medium="image">
			<media:title type="html">lastaction1</media:title>
		</media:content>
	</item>
	</channel>
</rss>