Calculating an expiration date
You can direct Infor Operations and Regulations to calculate the expiration date for a license using an expiration date formula. For example, you could write a formula that automatically expires the license if it is inactive for more than six months. You specify an expiration date formula when you define a new license type. You must also select the Calculate Expiration Date check box for each milestone at which you want Infor Operations and Regulations to calculate the expiration date.
Expiration data formulas use the oLicenseApp
object (an instance of the Hansen.CDR.BusinessLicense.iLicenseApplication
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 a license to expire six months after the license was processed. This formula will base its expiration date on the Processed status date.
If (oLicenseApp.LicenseDateTime.Year > 1) Then
ExpirationDate = oLicenseApp.LicenseDateTime.AddMonths(6)
End If
This formula sets a license to expire 30 days after it was issued. This formula will base its expiration date on the Issued status date.
If (oLicenseApp.LicenseIssuedDateTime.Year > 1) Then
ExpirationDate = oLicenseApp.LicenseIssuedDateTime.AddDays(30)
End If
This formula sets a license to expire one week after it became inactive. This formula will base its expiration date on the Inactive status date.
If (oLicenseApp.InactiveDateTime.Year > 1) Then
ExpirationDate = oLicenseApp.InactiveDateTime.AddDays(7)
End If
This formula sets a license to expire three months after it was last renewed. This formula will base its expiration date on the Renewed status date.
If (oLicenseApp.LastRenewalDateTime.Year > 1) Then
ExpirationDate = oLicenseApp.LastRenewalDateTime.AddMonths(3)
End If
This formula sets a license to expire if no activity performed on it for six months. This formula will base the expiration date on the date of the last recorded activity for the license. An activity is an update or addition to the license or to its supporting information, such as fees, inspections, reviews, and conditions.
ExpirationDate = oLicenseApp.LastActivityDateTime.AddMonths(6)