Summary

This script ensures that the target date is less than or equal to the current date. This is all inside of an alert script so that if the target date is greater than the current date, an alert will be fired to the user to ask them to verify and correct the date. The “currentDate” command returns the current date.


Script

<script scriptId="futureDate">
    <body>
        <s:alert>
            <s:expression>
                <s:lte>
                    <s:datePath path=":value"/>
                    <s:currentDate/>
                </s:lte>
            </s:expression>
            <s:correction>
                <s:string value="optional"/>
            </s:correction>
            <s:text>
                <s:string value="This date should not be in the future.  Please check."/>
            </s:text>
        </s:alert>
    </body>
    <target typeId="add" when="preprocess" shouldReconcile='true'/>
    <target typeId="questions" when="preprocess" shouldReconcile='true'/>
    <target typeId="here" when="preprocess" shouldReconcile='true'/>
</script>



Need more help?

Please visit the Fountayn Contact Information page.