Calculating an expiration date
You can direct Infor Public Sector to calculate the expiration date for an application using an expiration date formula. For example, you could write a formula that automatically sets the expiration date for an application two years after a permit has been issued. You specify an expiration date formula when you define a new application type. You must also select the Calculate Expiration Date check box for each milestone at which you want Infor Public Sector to calculate the expiration date.
Expiration data formulas use the
oProjectApp
object (an instance of the
Hansen.CDR.Project.iProjectApplication
class) to set
ExpirationDate
to a date value. For more information
about this object and for sample code, click the
Information tab in the Formula
Editor.
Examples
This formula sets an application to expire one year after the application was processed. This formula will base its expiration date on the Processed status date.
If (oProjectApp.ApplicationDateTime.Year > 1) Then
ExpirationDate = oProjectApp.ApplicationDateTime.AddYears(1)
End If
This formula sets an application to expire 90 days after the application was approved. This formula will base its expiration date on the Approved status date.
If (oProjectApp.ApprovedDateTime.Year > 1) Then
ExpirationDate = oProjectApp.ApprovedDateTime.AddDays(90)
End If
This formula sets an application to expire three months after the application was finalized. This formula will base its expiration date on the Final status date.
If (oProjectApp.FinalizedDateTime.Year > 1) Then
ExpirationDate = oProjectApp.FinalizedDateTime.AddMonths(3)
End If
This formula sets an application to expire if it has been inactive for 8 months. This formula will base the expiration date on the date of the last recorded activity for the application. An activity is an update or addition to the application or to its supporting information, such as fees, inspections, reviews, and conditions.
ExpirationDate = oProjectApp.LastActivityDateTime.AddMonths(8)