<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Very simple (hopefully) data lookup issue.</title><link>https://www.infopathdev.com:443/forums/thread/98791.aspx</link><pubDate>Mon, 25 Aug 2014 14:59:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:98791</guid><dc:creator>Steve Goodger</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/98791.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=98791</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;There&amp;#39;s a few things you can do to harden the process - I went through the same growing pains with my purchase requisitions.&lt;/p&gt;&lt;p&gt;Protect the form - create an InfoPath&amp;nbsp;column called &amp;quot;Status&amp;quot; and promote it to SP - hide it from the view.&lt;br /&gt;In your SP workflow, set the Status to &amp;quot;ReadOnly&amp;quot; or &amp;quot;Edit&amp;quot; - depending on your requirements.&lt;br /&gt;In InfoPath - on form load check the Status name - if ReadOnly switch to another form view that removes Submit&amp;nbsp;button and all fields are readonly.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;For document numbering, this was a real brain-teaser and I called on a few other articles to help.&amp;nbsp; Basically - you want to create a counter in your SharePoint table.&lt;br /&gt;I created a numbering system that changed by the date.&amp;nbsp; E.g. 20140825-01, 02, 03 etc&amp;nbsp;(and resets to 01 on the change of a&amp;nbsp;day/month or year) - This required 4 SP columns of data and an InfoPath field.&lt;/p&gt;&lt;p&gt;1. CalcYear - SPColumn - Calculation based = CONCATENATE(YEAR(Modified)) - gives me 2014&lt;br /&gt;2. CalcMonth - same =CONCATENATE(REPT(&amp;quot;0&amp;quot;,2-LEN(MONTH(Modified))),MONTH(Modified)) - gives me 08 for August (not just 8)&lt;br /&gt;3. CalcDAY - same&amp;nbsp;=CONCATENATE(REPT(&amp;quot;0&amp;quot;,2-LEN(DAY(Modified))),DAY(Modified)) - gives me 25, again formatted to be 01 for single digit days&lt;br /&gt;4. IndexValue = InfoPath field, single line of text&lt;br /&gt;5. NextIndex = SPColumn = Formula Based = CONCATENATE(REPT(&amp;quot;0&amp;quot;,2-LEN(IndexValue+1)),IndexValue+1)&amp;nbsp; - this gives me the 2-digit 01,02,03)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Now on InfoPath - my IndexValue field does a data retrieve to get NextIndex[last()] for the default value.&lt;br /&gt;I&amp;nbsp;need to check if a post is happening on the same day (if so increment by 01), or reset the counter. &lt;br /&gt;I do this by comparing the last post in SP, and the current date (Field called PostDate = function &amp;quot;today()&amp;quot;&amp;nbsp;on the InfoPath form) and use a function:&lt;br /&gt;&lt;br /&gt;NextNumber = concat(substring(IndexValue, 1, (contains(LastPostDate, PostDate)) * string-length(IndexValue)), substring(&amp;quot;01&amp;quot;, 1, (not(contains(LastPostDate, PostDate))) * string-length(&amp;quot;01&amp;quot;)))&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Note you may have to do some formatting to ensure they&amp;nbsp;both&amp;nbsp;look the same &amp;quot;MM-dd-yyyy&amp;quot;&lt;br /&gt;I also get rid of the InfoPath form submit button (and remove it from all views and permissions) and create my own custom submit button with rules - it will:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Validate the fields&lt;br /&gt;Set the Status column to ReadOnly&lt;br /&gt;Calculate the Document Number based on the above - important to create the number on POST, to avoid conflicts with multiple users.&lt;br /&gt;=concat(&amp;quot;REQ-&amp;quot;, &amp;quot;-&amp;quot;, translate(PostDate, &amp;quot;-&amp;quot;, &amp;quot;&amp;quot;), &amp;quot;-&amp;quot;, NextNumber) - gives me REQ-20140825-01,02,03, then REQ-20140826-01,02...&lt;br /&gt;Post the document to SP&lt;br /&gt;&lt;br /&gt;It&amp;#39;s a lot to digest in a short forum post, but here is an article that may help you where my descriptions fail:&lt;br /&gt;&lt;a href="http://dlairman.wordpress.com/2011/01/10/add-a-unique-auto-incrementing-column-to-a-sharepoint-list/"&gt;http://dlairman.wordpress.com/2011/01/10/add-a-unique-auto-incrementing-column-to-a-sharepoint-list/&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Cheers&lt;br /&gt;Steve&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Very simple (hopefully) data lookup issue.</title><link>https://www.infopathdev.com:443/forums/thread/98786.aspx</link><pubDate>Mon, 25 Aug 2014 00:08:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:98786</guid><dc:creator>themunga</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/98786.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=98786</wfw:commentRss><description>&lt;p&gt;Hi everyone,&lt;/p&gt;&lt;p&gt;&amp;nbsp;I need help with a specific step that I am trying to get past in my InfoPath form, and I would like to do it without using code. Basically I have an email form that does the following:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Standard user fills in a form from SharePoint&lt;/li&gt;&lt;li&gt;Form&amp;nbsp;is then emailed&amp;nbsp;to an admin user based on selection criteria in step 1 (standard user has now &amp;quot;finished&amp;quot; their part)&lt;/li&gt;&lt;li&gt;Form is either approved or not approved by an admin user after opening the InfoPath file in Outlook.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;What I would like to do is have the form&amp;nbsp;inaccessible after step&amp;nbsp;3 has been completed.&amp;nbsp;Because of the way that email forms work, the state of the form stays the same as when it was submitted and the admin user is able to re-open the form from Outlook even if they have &amp;quot;completed&amp;quot; the form (I have not found anything to the contrary so please enlighten me if I am wrong). Re-opening the form should not be able to happen for various reasons.&amp;nbsp;I have tried to make this solution:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Generate a unique number (don&amp;#39;t recalculate so number is static) when form is loaded&lt;/li&gt;&lt;li&gt;When the admin user clicks &amp;quot;Approve&amp;quot;, set a rule to submit the document to a SharePoint library with the unique number as above&lt;/li&gt;&lt;li&gt;If form is loaded again, check the Sharepoint library for a file with the same name as the unique number and if it matches, display a message and close the form before any&amp;nbsp;inputs can be entered.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Biggest issue here is that I can&amp;#39;t query SharePoint for the &amp;quot;Name&amp;quot; field in the document library through the normal InfoPath connection wizard so I have to do a SQL lookup on all documents in SharePoint, and I am having issues trying to get a&amp;nbsp;query that&amp;nbsp;goes &amp;quot;Check SQL server for this document name&amp;quot; and putting it into a rule.&amp;nbsp;Can anyone help me with a solution? &lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks everyone.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>