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 one year after a discretionary permit has been issued for it. 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 oPlanningApp object (an instance of the Hansen.CDR.Planning.iPlanningApplication 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 six months after the application was processed. This formula will base its expiration date on the Processed status date.


If (oPlanningApp.ApplicationDateTime.Year > 1) Then
  ExpirationDate = oPlanningApp.ApplicationDateTime.AddMonths(6)
End If

This formula sets an application to expire one year after it was approved. This formula will base its expiration date on the Approved status date.


If (oPlanningApp.ApprovedDateTime.Year > 1) Then
  ExpirationDate = oPlanningApp.ApprovedDateTime.AddDays(7)
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 (oPlanningApp.FinalizedDateTime.Year > 1) Then
  ExpirationDate = oPlanningApp.FinalizedDateTime.AddMonths(3)
End If

This formula sets an application to expire if it has been inactive for six 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, reviews, and conditions.


ExpirationDate = oPlanningApp.LastActivityDateTime.AddMonths(6)