SharePoint Workflow Logic (Math)

Matt Pinkston
Matt Pinkston used Ask the Experts™
on
I have a small sharepoint app that is a very simple list with an entry form.  One of the fields on the screen is request date.  The issue I run into is that when the user enters a request after 9:00am ET that date cannot be today it needs to get set to tomorrow.
 
q1:  can anything be done at the screen level to disallow todays date if time > 9:00am
 
q2: if I need to do in my workflow, what is the logic to add +1 to the request date field?  so Today +1...

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jamie McAllisterCloud Expert
Most Valuable Expert 2013
Top Expert 2014

Commented:
In the list screen on the ribbon you should see a purple button that allows you to edit the form in Infopath.

Using Infopath you could add a validation rule to the field that runs based on a condition you specify.

Possible this could be set to a time (not specifically tried it).

If not you can also put VB in the background of the form to validate as richly as you like. No need to go near the workflow code.

Users of the form DO NOT need Infopath to use the changes you make.

http://www.bizsupportonline.net/infopath2007/infopath-basics-3-ways-validate-data-infopath.htm
Matt PinkstonEnterprise Architect

Author

Commented:
SPD 2007 :(
Matt PinkstonEnterprise Architect

Author

Commented:
I think it needs to be in a workflow, but not sure how to check if time is after 9:00am
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Create a calculated column in your list and use the following formula:

=IF(HOUR(Created)>=9,DATE(YEAR(Created),MONTH(Created),DAY(Created)+1),DATE(YEAR(Created),MONTH(Created),DAY(Created)))

Hope that helps!

Hank
Matt PinkstonEnterprise Architect

Author

Commented:
what will the calculation return?
If someone creates a list item on or after 9AM, it will show the date for tomorrow, otherwise it will show todays date.  It determines the time based on the Created (date) field.
Matt PinkstonEnterprise Architect

Author

Commented:
can one more piece of logic be added?

If the user had selected a date in the future (Today plus anything) then it would just leave the date as is.
What are the key field names you are concerned about?  I was under the assumption that you were keying on the time that the record was created.
Matt PinkstonEnterprise Architect

Author

Commented:
it is a date selction field called triage date

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial