Manipulating dates in InfoPath 2010

Hello,
I am trying to dynamically populate a date field to post the date seven days from now. In other words, a week from today.
I thought that the function addDays(today(),7) would work, but the date field throws a validation error and says that "only date or datetime values are allowed."
I figured the problem was with how the date was displayed as it was displaying in yyyy-mm-dd format. So, I decided to format the date as such mm/dd/yyyy using the following rule:
concat(substring(xdDate:AddDays(xdDate:Today(), 7), 6, 2), "/", substring(xdDate:AddDays(xdDate:Today(), 7), 9, 2), "/", substring(xdDate:AddDays(xdDate:Today(), 7), 1, 4))
The format looks ok, but InfoPath still throws the validation error. Any help would be appreciated.
David

I figured it out, I should have used the Now() function with a SharePoint list instead of Today()

Similar Messages

  • Is possible to capture the SP username of who is making submission of the data from an InfoPath 2010 form?

    Hi all,
    Does anyone know how to capture the SP username of who is making submission of the data from an InfoPath 2010 form? I looking to avoid the user need to type extra information like username/ manager name, etc; and then use code behind to be doing validation
    before to push that data to an sql server.
    Any suggestion , book reference , link is acceptable 
    thanks in advance
    CRISTINA& MICROSOFT Forum

    Hi Cristina,
    Please check the following article with using web service UserProfileService.asmx to get the current user profile in InfoPath code behind and use the validating event to do some complex validation, it should help.
    http://blogs.msdn.com/b/infopath/archive/2007/03/07/get-the-user-profile-through-moss-web-services.aspx
    http://codesupport.wordpress.com/2010/04/05/sharepoints-userprofileservices-getuserprofilebyname-method/
    http://www.bizsupportonline.net/infopath2007/infopath-basics-3-ways-validate-data-infopath.htm
    http://henry-chong.com/2010/12/infopath-validation-gotcha/
    Thanks
    Daniel Yang
    TechNet Community Support

  • Getting error while submitting data to excel workbook through excel services in InfoPath 2010

    Hi,
    I have a requirement where in have to fetch the calculated values from the excel workbook through InfoPath 2010 form.
    When I am submitting cell value to excel workbook using SetCellA1 by executing following action:
    "Submit using data connection: dataconnection"
    I am unable to submit form. It is giving "there has been an error while processing the form" in the front end. I checked the event viewer and it displayed following exception:
    There was a form postback error. (User: xxxx, Form Name: yyyyyyyy, IP: , Request:
    http://asadadsas Request Form Template.xsn&SaveLocation=/somelocation, Form ID: urn:schemas-microsoft-com:office:infopath:formname:-myXSD-2010-09-20T15-02-34, Type: KeyNotFoundException, Exception Message: The given key was
    not present in the dictionary.)
    I was successfully able to submit the form using InfoPath client but it is giving error in the browser.
    Is there any way or configuration that I should do to resolve this issue.
    Any suggesttion would be of great help.
    Thanks,
    Sharepoint Consultant from NY, USA

    I have exactly the same problem. The form is supposed to be submitted to the SOAP Web service (http://servername/_vti_bin/ExcelService.asmx) using the SetCellA1 operation, works fine in InfoPath Filler, but when I try to submit it in the browser, I get this
    error:
    There was a form postback error. (User: WINGTIP\Administrator, Form Name: NewEventForms, IP: , Request: http://intranet.wingtip.com/et/_layouts/FormServer.aspx?XsnLocation=http://intranet.wingtip.com/et/NewEventForms/Forms/template.xsn&SaveLocation=http://intranet.wingtip.com/et/NewEventForms&Source=http://intranet.wingtip.com/et/NewEventForms/Forms/AllItems.aspx&DefaultItemOpen=1,
    Form ID: urn:schemas-microsoft-com:office:infopath:NewEventForms:-myXSD-2011-12-29T18-18-45, Type: KeyNotFoundException, Exception Message: The given key was not present in the dictionary.)
    followed by
    Unhandled exception when rendering form on postback System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.    
     at System.ThrowHelper.ThrowKeyNotFoundException()    
     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DatabaseHelper.GetSchemaXml(String namespaceUri, Solution solution, String dataObjectName, SchemaNavigator& schema, XPathNavigator& originalSchema, XmlNamespaceManager& namespaceManager)
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.PartFragmentHelper.IsDataSetNode(Solution solution, XPathNavigator node)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.PartFragmentHelper.ApplyPartFragmentGather(DataAdapter adapter, XPathNavigator sourceDOM, DataObjects dataObjects, XPathNavigator targetDOM, PartFragment[] partFragments, Boolean[]& areDataSets)
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterWebServiceSubmit.Execute(Document document, Uri soapAction, Uri serviceUrl, XPathNavigator querySubDOM, XPathNavigator resultsSubDOM, XPathNavigator errorsSubDOM, Int64 timeout, DataAdapterCredentials
    credentials, Boolean useDcl, Boolean useProxy, Boolean useSelf)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterWebServiceSubmit.ExecuteInternal(XPathNavigator queryFields, XPathNavigator resultFields, XPathNavigator errors)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.RuleAction.EvaluateExpression(Document document, XPathNavigator currentTarget)    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.RulesRuleSet.EvaluateExpression(Document document, XPathNavigator targetNavigator)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.ExecuteDefaultSubmitAction()    
     at Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonSubmit.Click(Document document, XPathNavigator container)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventClick.Play(Document document, BindingServices bindingServices, EventLogProcessor eventLogProcessor)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventLogProcessor.ExecuteLog(Int32 expectedEventLogID)    
     at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.<>c__DisplayClass13.<PlayEventLog>b__11()    
     at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
    What might be wrong? Are there any InfoPath configurations that need to be done? And, do I need to save the connection to the Excel Service Service Application to a connection file?
    Thanks,
             Boris

  • Create an InfoPath Form to Auto Populate Data in SharePoint 2010

    In Anne Stenberg's Blog from 2 Nov 2011 3:00 PM "How to Create an InfoPath Form to Auto Populate Data in SharePoint 2010" she artfully steps through how to create an InfoPath Form to Auto Populate Data. It works but... Jason, another user, 
    wrote whenever the form is opened again either to view or edit, it displays the current users information instead of the value of the person who completed the form in the first place.
    Anne's response was "Hi Jason - I had forgotten I had that problem, too. Change the Form Load rule's condition to
    DisplayName is blank and that should work."
    My problem is I can't find anything other than AccountName in "Select a Field or Group" [GetUserProfileByName (Secondary)] to use in the Condition statement that will correct the problem.
    Any help will be very appreciated.
    Thanks,
    Joe

    Hi Joe,
    I recommend to add one more condition in Form Load to make the form not be populated with current user’s information (You can change Title to another column which should not be blank when users create a new item).
    Best regards,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • SharePoint 2010 and InfoPath 2010 - Load data from another form

    Hello,
    I have two questions on this topic.
    Is it possible to open an empty InfoPath form and give the user the option of loading it with data from a previously submitted form?  They want the ability to save some time of filling in some fields that were entered in an earlier form.  Any description
    of how or a link would be appreciated.
    Also, if I create an InfoPath form template in a SharePoint Form Library like above, the user would like to be able to have multiple forms associated with each other.  There would be some key that packaged them with each other.  Then from within
    one of the form, there would be an option to submit the whole "package" at once.  All the forms associated with that one key.  Again, any examples or links would help.
    Thank you!

    You can use InfoPath Query Data connection to point to a library / list where your data is located.
    For loading data, you should be using Form Load event, and then populate ID's to a Drop down list.
    when the user selects the ID from the Drop Down list, you can write another rule to query data based on the ID's from the list and store the values in your current form.
    For the second question, you should try creating a single form with multiple views. and show hide views based on user or business logic.
    You can write multiple submit rules to submit Form data to different different library / list.
    here are some links for your reference -
    Add, delete, and switch views (pages) in a form
    http://office.microsoft.com/en-us/infopath-help/add-delete-and-switch-views-pages-in-a-form-HA101732801.aspx
    Add a data connection to a SharePoint document library or list
    http://office.microsoft.com/en-us/infopath-help/add-a-data-connection-to-a-sharepoint-document-library-or-list-HP010093160.aspx
    Automatically query by using a data connection
    http://office.microsoft.com/en-us/infopath-help/automatically-query-by-using-a-data-connection-HP001100271.aspx
    SharePoint List Data Connections in InfoPath 2010
    http://blogs.msdn.com/b/infopath/archive/2010/05/06/sharepoint-list-data-connections-in-infopath-2010.aspx
    Hope this helps!
    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/

  • InfoPath 2010 SQL Data Connection - Related Table is Not a Repeating Group

    I'm creating a InfoPath 2010 database form. In my main connection I want to query a parent table and a related child table. When I go through the wizard, the resulting data structure is not correct.  The child group that InfoPath creates isn't
    a repeating group, but it should be. I've done this many times before and never had this problem.
    In other words, when I open up the main data source, the little blue disclosure triangle is missing from the child group.
    Any help would be greatly appreciated.
    Thank you.

    Hi,
    ODBC driver for Excel does not support deleting data.
    I'm afraid there is no solution via SQL as in Oracle to use SQL with Excel you can only use ODBC, see OLEDB in previous versions to 11G.
    Unfortunately with ODBC or OLEDB driver for Excel , DELETE is not supported.
    regards
    Mireille

  • Filtering a sharepoint 2010 list using Multiple values from Multi-Select Filtering In Infopath 2010 form

    I am creating a browser based InfoPath 2010 form Calendar Filtering
    using SharePoint 2010 Calendar List (All Events) and InfoPath 2010.  This form has data connection to the Calendar list. Goal is to
    compare Calendar Events from Current Year to Previous Year. I have 2 columns called - Previous Year and Current Year. I have 2 drop-down controls in each columns called
    Select Year  and Select Week. I also have common drop down called
    Select Category which holds category of the events such as weather, power outages and so on. I wish to display specific events on specific date and specific week on both columns.
    I am able to filter the list based upon Year and Week
    on both these columns by applying rules in the InfoPath 2010 form. The real issue is that I want to apply category filter on the search result of
    Year and Week. Or it needs to show all the values if I
    select Category value as All. So I wish to apply filter on Search results using Category drop-down list selection.
    Hope I could explain this better but I tried to do the best here. Any suggestions, hint, or pointers
    Thanks
    Snehal H Rana
    Thanks Snehal H.Rana SharePoint Consultant

    I am creating a browser based InfoPath 2010 form Calendar Filtering
    using SharePoint 2010 Calendar List (All Events) and InfoPath 2010.  This form has data connection to the Calendar list. Goal is to
    compare Calendar Events from Current Year to Previous Year. I have 2 columns called - Previous Year and Current Year. I have 2 drop-down controls in each columns called
    Select Year  and Select Week. I also have common drop down called
    Select Category which holds category of the events such as weather, power outages and so on. I wish to display specific events on specific date and specific week on both columns.
    I am able to filter the list based upon Year and Week
    on both these columns by applying rules in the InfoPath 2010 form. The real issue is that I want to apply category filter on the search result of
    Year and Week. Or it needs to show all the values if I
    select Category value as All. So I wish to apply filter on Search results using Category drop-down list selection.
    Hope I could explain this better but I tried to do the best here. Any suggestions, hint, or pointers
    Thanks
    Snehal H Rana
    Thanks Snehal H.Rana SharePoint Consultant

  • InfoPath 2010 form parsing error with 3600 execution timeout value in SharePoint 2010

    Hi,
    I have a list in SharePoint 2010 with 100 columns where 25 of them are calculated columns. This list is designed by InfoPath 2010 with two secondary data connections to pull a few data from another two lists. There are 25 set value rules with the submit
    button in InfoPath from. At present, the list is containing around 1000 items.
    The problem is, when I published the InfoPath form it throws an error:
    The SOAP message cannot be parsed.
    In fact, the execution timeout is set to 3600 in config file. When I delete items from the list and keep it around 700 the InfoPath form publish then.
    Could somebody tell me why this problem and what is the possible solution.
    Thanks in advance.

    Hi pointtoshare,
    According to your description, my understanding is that you got an error when you published InfoPath form.
    Please modify the web.config file like :
    <location path="_layouts/UploadEx.aspx">
         <system.web>
           <httpRuntime maxRequestLength="51200" executionTimeout="300" />
         </system.web>
       </location>
    And modify the <securityPolicy> section like :
    The web.config file is in C:\inetpub\wwwroot\wss\VirtualDirectories\spwebappname.
    There is another reason for this issue, please take a look at :
    http://www.heyweb.net/2011/07/infopath-the-soap-message-cannot-be-parsed/
    Here are some similar posts for you to take a look at:
    http://social.technet.microsoft.com/Forums/en-US/ea8da113-fe9a-4878-9994-c1f24cc85c37/soap-error-when-publishing-infopath-form-to-sharepoint?forum=sharepointcustomizationprevious
    http://sharepointshah.blogspot.in/2012/11/soap-message-cannot-be-parsed-error.html
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • How to populate drop down list in infopath 2010 with form Active Directory resources.

    I want to populate drop down list in infopath 2010 with Active directory resources.
    Kindly let me know how to do this.

    Actually I posted an alternative approach, whoops. This is the Web service way, but both will work;
    http://blog.mangroveweb.com/pre-populating-an-infopath-from-with-mysql-data-using-a-net-web-service/using-sharepoints-getuserprofilebyname-web-service-to-retrieve-ad-account-information/
    w: http://www.the-north.com/sharepoint | t: @JMcAllisterCH | YouTube: http://www.youtube.com/user/JamieMcAllisterMVP

  • The security validation for this page is invalid – Infopath 2010

    Hello Experts,
    I have created browser enabled Infopath form and written a custom code (infopath 2010). I have a “Save” button on a form that submits the data into multiple relational sharepoint list. While debugging through VSTA everything goes well and successfully submits
    the data, but after publishing a form(browser enabled) I am not able to save a data to sharepoint list. When I Clicked on save button, it just refreshing a page, even the same was getting after
     made it to full trust and approved by Admin.
    Before this I was using “Submit” button to submit a form, that time I was getting a popup with the message “There has been an error while processing the form”. And in log files it was showing error message as “The security validation
    for this page is invalid”.
    I referred many blogs regarding validation error and tried almost everything in every way, some of shortly mentioned below,
    Formdigest (It not works for me)
    Security Validation (It works perfectly)
    The second option is working for me.  (But this is not a good practice and also not recommended)
    Just want to know “Without making Security Validation Off” how can I resolved this validation issue from infopath 2010 form.
    Please share your thoughts on this. Any help is appreciated.
    Regards,
    Uday

    Hi Uday,
    Have you tried SPWebapplication.FormDigestSettings.Enabled = false to turn off the digest setting property for the web application? See this blog for the details.
    http://ktskumar.wordpress.com/2009/03/09/the-security-validation-for-this-page-is-invalid-click-back-in-your-web-browser-refresh-the-page-and-try-your-operation-again/
    Thanks & Regards,
    Emir
    Emir Liu
    TechNet Community Support

  • How to add User Permissions to form created in InfoPath 2010 created for SharePoint document Library

    Hi,
    I created a form in InfoPath 2010 with three views (one for user input, the other two views to be used by supervisors) and published this to a SharePoint 2010 document library. Now the way this form is supposed to work is that when a User goes to the document
    library and adds a document, it is supposed to open the Form with the User's input view. When the User submits the document, only him/her should be able to open and possibly edit the the form. When the Immediate Supervisor opens the form, it should open in
    the Supervisors view and allow them to fill in only their section and not be able to edit or alter the user's data. When the Immediate Supervisor saves the document, the Over-all Supervisor should be able to open it in their view and not be able to edit or
    alter the sections filled out by the User and Immediate Supervisor.
    How would i go about completing this? I have the views created but now have the problem of associating these views with their respective users or groups.

    Hello,
    You need to first create user group in sharepoint site then add user in group according to their role. Later you need to call usergroup.asmx web service to get current logged-In user group name so you can switch view and also apply rule for editing or disabling
    controls in form.
    Follow this link to get group name:
    http://social.technet.microsoft.com/wiki/contents/articles/13271.sharepoint-2010-extracting-user-group-of-current-login-user-in-infopath-2010.aspx
    http://social.msdn.microsoft.com/Forums/en-US/018f5184-5c83-4a53-b66b-8c376fc800fc/how-to-get-current-users-sharepoint-group-name-sharepoint-2010-infopath-2010
    To apply rule on control:
    http://office.microsoft.com/en-in/infopath-help/add-rules-for-performing-other-actions-HA101783373.aspx
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Why does text field in InfoPath 2010 show user name with two commas between first name and last?

    Here's the problem. I have a text field called Manager in an InfoPath 2010 form that is getting populated by a drop down field called
    Business Unit.
    The Business Unit drop-down field is pulling information from
    column A in a custom list via a managed data connection. The custom List has two columns:
    Title & Manager. 
    The Manager column in the custom list is a 'Person or Group' type column.
    The Data Connection pulls both the Title, Manager
    (and ID) data.
    There is a rule on the Business Unit drop-down field to change the value of the
    Manager text field with the Manager data on the custom list. The rule pulls the
    Manager information and filters the value to match the
    Business Unit on the Data Connection with the Business Unit drop-down
    field value (Main).
    The Business Unit drop-down field works great and pulls the value from the custom list, and the rule populates the Manager text field. The problem is that Manager text field shows the name as such:
    [smith,, john]. Notice the two commas between the last and first name. There should only be
    one comma!
    Anyone have an idea why the text field is appearing with two commas?
    Arnel

    Hi all,
    I have a workaround for this. I have an InfoPath 2010 form pulling data from a SP2010 list. The user chooses a System (Business Unit) from the dropdown list and that choice auto populates the associated user (Manager) for that system. I had to
    use concatenation, substring before and substring after to display the correct data.
    concat(substring-before(DisplayName, ",, "), ", ", substring-after(DisplayName, ",, "))
    DisplayName is the original data for the field. I am able to cut & paste this field into the formula. Therefore, I added a few spaces to separate it from the actually formula for future use.
    Select Insert Function
    Select concat
    Select the first link to double-click to insert field
    and then select Insert Function
    Select the Text category and choose substring-before
    Select the third link to double-click to insert field
    and then select Insert Function
    Select the Text category and choose substring-after
    Copy and paste your fieldname (in my case DisplayName) in the
    double-click to insert field
    parts of the substring-before and substring-after links.
    Delete the middle double-click to insert field link
    Add quotes, spaces and commas so that they match the following format:
    concat(substring-before(DisplayName, ",, "), ", ", substring-after(DisplayName,
    Translation:
    concat(substring-before(Doe,, John, ",, "), ", ", substring-after(Doe,,
    John, ",, "))
    Bring together all of the text before ",," (i.e. Doe) with ", " (comma, space) and all text after ",," (i.e. John).
    It should return
    Doe, John.
    I hope this makes sense. I have these instructions with screenshots if you need them, contact me.

  • How to execute SQL Query in Code behind Using infopath 2010?

    Hi,
    I've repeatable on infopath form, and want bind it throuth code behind from SQL table. My question is that how to execute SQL Query in code behind from infopath as well as how would get Query result to bind repeatable control?
    Thanks In Advance
    Shoeb Ahmad

    Hello,
    You first need to add new SQL DB connection then you need execute connection from code behind.
    See below link to create new connection
    http://office.microsoft.com/en-in/infopath-help/add-a-data-connection-to-a-microsoft-sql-server-database-HP010092823.aspx:
    http://www.bizsupportonline.net/infopath2010/connect-infopath-2010-sql-server-2008-table.htm
    Then use below code to execute this connection:
    AdoQueryConnection conn = (AdoQueryConnection)(this.DataConnections["Data connection name"]);
    string origCommand = Select * from tablename;
    conn.Command = origCommand;
    conn.Execute();
    Finally bind your table:
    http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm
    http://stevemannspath.blogspot.in/2010/09/infopath-20072010-populate-repeating.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to Prevent duplicates on Combination of Lookup columns in sharepoint 2010 using infopath 2010 form.

    Hi All,
    I have list with some Lookup columns like  City, Pin, and Text Column Name. All these are required columns.
    Now I want to prevent duplicates while submitting InfoPath form if a Combination of  City,Pin & Name. (like a Composite primary in Database is used.)
    Can some one help me on how to achieve this using InfoPath  2010 Rules, writing  rule in Xpath.
    Thanks in Advance.

    1. Add a secondary data connection to the list where the form will be submitted.
    2. Prior to submit via rules, set the query fields in the above connection: City, Pin & Name with values entered in the form. Query the data source and check if the result has values.
    3. Show error messages accordingly if exists else continue with Submit.
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • How to genetare reports(ssrs) with form library's data in sharepoint 2010

    Hi,
    How to genetare reports (ssrs) with form library's data in sharepoint 2010.I am saving infopath(2010) xml form data in form library.I have 500 and more forms in the form library( more forms can come in future).How to generate reports from this xml data (i
    want to make it automate)? Reports should get updated automatically when any changes made to data and if new form entered in the library.
    Please suggest possible solutions.I can not go for code base solution.( somthing SSIS, BCS or web service ....etc or anything else will be fine)
    Thanks in advance.

    Hi,
    According to your post, my understanding is that you wanted to generate SSRS report with form library in SharePoint 2010.
     In order to use the data stored on the InfoPath form, you need to add the controls on the form to be columns in SharePoint(This is the OOTB way without code).
    You can add the control during the publish process:
    Then when you create the SSRS report using the form library as the data source, you can use the fields just as the fields created in SharePoint.
    There is a tool called InfoPath DB in codeplex, you can have a look at it.
    http://infopathdb.codeplex.com/
    More reference:
    http://sharepoint.stackexchange.com/questions/28825/how-to-query-a-form-library-in-sharepoint-2010
    http://sharepoint.stackexchange.com/questions/38492/reporting-against-a-form-library
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

Maybe you are looking for