<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90127.aspx</link><pubDate>Fri, 24 May 2013 22:31:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90127</guid><dc:creator>Ravik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90127.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90127</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Hilary,&lt;/p&gt;&lt;p&gt;The size of my form template is 650kb, as much as I wanted to share it with you(My Guru:))&amp;nbsp;and get a feedback of my very first project in InfoPath.&amp;nbsp;One thing that,&amp;nbsp;I truly have to admit is that without the guidance that I had over the course of time&amp;nbsp;from you and from the InfoPath dev team, I wouldn&amp;#39;t have come anywhere near&amp;nbsp;to the end of my project. Well I still need your help :)&amp;nbsp;to complete it.&amp;nbsp;Please see below the XPath of caseId as requested&lt;/p&gt;&lt;p&gt;&lt;span style="color:black;font-size:10pt;mso-ansi-language:EN-GB;mso-fareast-language:EN-GB;mso-bidi-language:AR-SA;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;

&lt;/font&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:_x007b_2a9d2794_x002d_aeb9_x002d_4dcf_x002d_993f_x002d_4303298d5a7c_x007d_&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;

Thanks&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Ravi&lt;/p&gt;</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90118.aspx</link><pubDate>Fri, 24 May 2013 19:00:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90118</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90118.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90118</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi - so your screenshot shows that you now have the Case Id in the data source - does that contain the info that you need? Is Case Id going to be &amp;quot;GEN-000002&amp;quot; and so on? Can you just attach your template so I can help w/ the formula? If not, can you copy the XPath for the new field of Case Id in your secondary data source and paste in a reply?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90117.aspx</link><pubDate>Fri, 24 May 2013 17:53:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90117</guid><dc:creator>Ravik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90117.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90117</wfw:commentRss><description>Hi hilary, please see the attached.

Thanks.</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90111.aspx</link><pubDate>Fri, 24 May 2013 16:33:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90111</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90111.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90111</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;In my secondary data source, I have two pieces of information - the ID of the item and item name (which contains the prefix needed for the more complex XPath filter). In your secondary data source, I just see the ID. You should also include the info from your list that indicates the type.&lt;/p&gt;</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90108.aspx</link><pubDate>Fri, 24 May 2013 15:58:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90108</guid><dc:creator>Ravik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90108.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90108</wfw:commentRss><description>Hi Hilary,

Please see the attached document.

Thanks</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90083.aspx</link><pubDate>Thu, 23 May 2013 17:22:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90083</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90083.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90083</wfw:commentRss><description>&lt;p&gt;The forum is not always respectful of formatting - it can be rather fussy.&lt;/p&gt;&lt;p&gt;What you probably need to do is get a count of the cases with the same prefix - GEN, for example. I put together a simple sample form - save it locally, right click and select design and then preview to see the formula in action.&lt;/p&gt;</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90059.aspx</link><pubDate>Thu, 23 May 2013 12:47:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90059</guid><dc:creator>Ravik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90059.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90059</wfw:commentRss><description>Sorry about the text in my previous reply. 

 Please see the attached Zip file which has Word document.


Thanks</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90058.aspx</link><pubDate>Thu, 23 May 2013 12:34:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90058</guid><dc:creator>Ravik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90058.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90058</wfw:commentRss><description>sorry about the above format..will post another one</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90057.aspx</link><pubDate>Thu, 23 May 2013 12:28:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90057</guid><dc:creator>Ravik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90057.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90057</wfw:commentRss><description>Hi Hilary(Guru)!

Thank you very much for your comments, you did really solve my issue. Never knew that DeleteSelf() would pitch me out the loop. All i did was took away this piece of code, because the next code i wrote was clearing away the rows  anyway.

// took this code away
else
                    {
                        WriteToDebug(&amp;quot;Removing empty attachment&amp;quot;);
                        caseAttachments.Current.DeleteSelf();
                    }


Thanks again.

Well i still have only one major issue which is a blocker. Hoping to get some advice. Ok here it goes.

The Infopath form that i had created has about 10 different case types. The Problem that i am facing is Auto- numbering each types. For ex . When the starts a new case they have an option to choose the case they wanted to raise .Case ID should look like Case Type+ ID (GEN-000001), and when the user creates  another case in GEN the  ID should look like (GEN-000002) but instead it is like (GEN-000039) and so on... because i have 10 different case i want all of them to  have a sequential order in ID. For  ex. when the chooses a different case, say CCF even though it starts with (CCF- 000001) but the very next case will  have an all together different ID such as (CCF-000040). How can i have each case types to generate ID&amp;#39;s sequentially?

Cant find this type of an issue in any article that i have looked in to.

The following is the calculated value which is in a rule that i use to generate an ID each time i click on a Save Case button. I have a field called CaseCount which gets the ID from a DataConnection the calculated value looks like this 

count(ID[contains(_x007b_2a9d2794_x002d_aeb9_x002d_4dcf_x002d_993f_x002d_4303298d5a7c_x007d_, Type)])

Then i created another field called TempCaseId and set its value as concat(my:Details/my:Type, &amp;quot;-&amp;quot;, &amp;quot;000001&amp;quot;)

I have then created three action rules for the Save Case button

1. Lookup Cases: which queries the data connection

2. Set First Case ID : condition is CaseId is blank and CaseCount  0 which runs the following actions

 A) Queries the data connection
 B) Sets Fields Value : TempCaseID and its Value as 

With Xpath

concat(my:Details/my:Type, &amp;quot;-&amp;quot;, substring(&amp;quot;000000&amp;quot;, 1, (6 - string-length(xdMath:Max(xdXDocument:GetDOM(&amp;quot;Case Lookup&amp;quot;)/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID[contains(../d:_x007b_2a9d2794_x002d_aeb9_x002d_4dcf_x002d_993f_x002d_4303298d5a7c_x007d_, xdXDocument:get-DOM()/my:myFields/my:Details/my:Type)]) + 1))), xdMath:Max(xdXDocument:GetDOM(&amp;quot;Case Lookup&amp;quot;)/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID[contains(../d:_x007b_2a9d2794_x002d_aeb9_x002d_4dcf_x002d_993f_x002d_4303298d5a7c_x007d_, xdXDocument:get-DOM()/my:myFields/my:Details/my:Type)]) + 1)

Without Xpath 

concat(Type, &amp;quot;-&amp;quot;, substring(&amp;quot;000000&amp;quot;, 1, (6 - string-length(max(ID[contains(_x007b_2a9d2794_x002d_aeb9_x002d_4dcf_x002d_993f_x002d_4303298d5a7c_x007d_, Type)]) + 1))), max(ID[contains(_x007b_2a9d2794_x002d_aeb9_x002d_4dcf_x002d_993f_x002d_4303298d5a7c_x007d_, Type)]) + 1)



Not sure what i am doing wrong here. I&amp;#39;ll be very grateful if you could help me with this issue.


Many Many Thanks Hilary.</description></item><item><title>Re: Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90037.aspx</link><pubDate>Wed, 22 May 2013 17:46:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90037</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90037.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90037</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I would loop through this iterator:&lt;/p&gt;&lt;p&gt;XPathNodeIterator caseAttachments = this.MainDataSource.CreateNavigator().Select(&amp;quot;/my:myFields/my:Details/my:Attachment&amp;quot;, NamespaceManager);&lt;/p&gt;&lt;p&gt;And, actually, I&amp;#39;m guessing the repeating group is Details? So, I&amp;#39;d likely do something like this - get the repeating group&lt;/p&gt;&lt;p&gt;XPathNodeIterator details= this.MainDataSource.CreateNavigator().Select(&amp;quot;/my:myFields/my:Details&amp;quot;, NamespaceManager);&lt;/p&gt;&lt;p&gt;foreach(XPathNavigator detail in details)&lt;/p&gt;&lt;p&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //check to see if attachment is blank - if so, delete row, if not, upload&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;DeleteSelf will pitch you out of the loop tho - so you&amp;#39;ll want to create a list of the items you wish to delete and then iterate through &lt;em&gt;that&lt;/em&gt; to do your actual deleting. Here&amp;#39;s a Stack Overflow thread that may help: &lt;a href="http://stackoverflow.com/questions/2524986/delete-remove-node-from-xpathnodeiterator-given-an-xpath"&gt;http://stackoverflow.com/questions/2524986/delete-remove-node-from-xpathnodeiterator-given-an-xpath&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Deleting empty rows from a button inside a repeating table</title><link>https://www.infopathdev.com:443/forums/thread/90020.aspx</link><pubDate>Wed, 22 May 2013 11:21:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:90020</guid><dc:creator>Ravik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/90020.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=90020</wfw:commentRss><description>The issue that I am facing trying to delete empty rows in a repeating table.

The scenario is, the user creates empty rows(blank) in the attachment field before inserting an attachment to the field (e.g : 3 blank rows and 4th one has a document attachment) which is inside a repeating table. I have an upload button, which not only uploads the document but also deletes any empty attachments. The problem that I am facing now is, when a user clicks the upload button on the 4th attachment field, the whole lot gets cleared including the last attachment.

Please see the attachment for code.



Hoping somebody would shed some light to this issue..

Many Thanks</description></item></channel></rss>