3

I made an InfoPath 2010 form using a SharePoint list template. The SharePoint list has a ReceivedDate field of DateOnlyType which I would like to set using the today() or now() on a "Set a field's" value rule.

Upon running the rule on a button click I get an error "Only date or date and time is allowed". How can I set this field without changing it from DateOnlyType to a TextType field?

5

You are using the the today() formula, it will return that error you are talking about. For SharePoint fields you have to use now().

  • Both today() and now() didn't work when I tested it in the office SharePoint server. At home, the now() function works. I'll need to test this again on other SharePoint test servers at the office. – Jimbo Alba Oct 27 '11 at 15:12
  • Thats strange, let me know if its some other issue :) – Anders Aune Oct 27 '11 at 21:35
  • It's working now when I tested it again. Hopefully, I will not encounter that problem again. Thank you. – Jimbo Alba Oct 28 '11 at 15:38
0

Try formatting the value 'Today()' or 'now()' in infopath using substring function to the date format you require in the list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.