ISService.HasExpired

Description

This function checks if the service has expired.

Syntax

object.HasExpired(aDateFrom, aDateTo)

Part Attribute Type Description
object Required
The object always implements the ISService interface
aDateFrom In, Required
DateTime
The lower date of the date range
aDateTo In, Required
DateTime
The upper date of the date range

Return Value

bool

Returns True if the service has expired.

Example

Display HasExpired for the specified service.

Dim aFilter
Dim aService
Dim aServices
Dim aMessage
Dim i

Set aFilter = Profile.CreateServicesFilter
aFilter.Description = "Injection"
set aServices = Profile.LoadServicesByFilter(aFilter)

aMessage = "Services Count = " & aServices.Count & vbNewLine
for i = 0 to aServices.Count - 1
  set aService = aServices.Item(i)
  aMessage = aMessage & vbNewLine & "----------------------------" & vbNewLine &_
    "Description: " & aService.Description & vbNewLine &_
    "Code: " & aService.Code & vbNewLine &_
    "Added: " & aService.Added & vbNewLine &_
    "Changed: " & aService.Changed & vbNewLine &_
    "Status: " & aService.Status & vbNewLine &_
    "ID: " & aService.ID & vbNewLine &_
    "Output Code: " & aService.OutputCode & vbNewLine &_
    "Default Delivery Time: " & aService.DefaultDeliveryTime & vbNewLine &_
    "Has Expired: " & aService.HasExpired(#09/09/2018#, #12/12/2018#) & vbNewLine 
next      

Profile.MsgBox(aMessage)      
Note:

In Profile Client v8 on User Interface Valid Date Range can be found in Maintain > Services > Edit the selected service > Financial > Valid Date Range.

Version information

Added in v7.8.0