Validate dates - SmartPlant Foundation - IM Update 48 - Help - Hexagon

SmartPlant Foundation Help

Language
English
Product
SmartPlant Foundation
Search by Category
Help
SmartPlant Foundation / SDx Version
10
SmartPlant Markup Plus Version
10.0 (2019)
Smart Review Version
2020 (15.0)

Picture properties can be used for validation rather than forcing formatting. This allows administrators to prevent users from inserting dates that are invalid, such as dates in the past.

Below are the constants that are supported and the logic performed. For example, if you enter FUTUREONLY in the picture, and the user enters a date that is before today, an error message appears.

Case "TODAY"

If ldatLocalDate.Date <> System.DateTime.Today Then

lstrReturnError = SPF.Client.Resources.SPFResources.GetStringWithParameters(9302, New String() {Picture})

End If

Case "FUTUREONLY"

If ldatLocalDate.Date <= System.DateTime.Today Then

lstrReturnError = SPF.Client.Resources.SPFResources.GetStringWithParameters(9302, New String() {Picture})

End If

Case "PASTONLY"

If ldatLocalDate.Date >= System.DateTime.Today Then

lstrReturnError = SPF.Client.Resources.SPFResources.GetStringWithParameters(9302, New String() {Picture})

End If

Case "NOTFUTURE" ' = today and past

If ldatLocalDate.Date > System.DateTime.Today Then

lstrReturnError = SPF.Client.Resources.SPFResources.GetStringWithParameters(9302, New String() {Picture})

End If

Case "NOTPAST" ' = today and future