Calculating a trade license expiration date
You can direct Infor Public Sector to calculate the expiration date for a license using an expiration date formula. For example, you could write a formula that automatically sets the expiration date for a license six months after a license has been issued for it. 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 Public Sector to calculate the expiration date.
Expiration data formulas use the
oTradeLicense
object (an instance of the
Hansen.CDR.TradeLicense.iTradeLicense
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 (oTradeLicense.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 (oTradeLicense.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 (oTradeLicense.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 (oTradeLicense.LastRenewalDateTime.Year > 1) Then
ExpirationDate = oLicenseApp.LastRenewalDateTime.AddMonths(3)
End If
This formula sets a license to expire if no activity has been 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, reviews, and conditions.
ExpirationDate = oTradeLicense.LastActivityDateTime.AddMonths(6)