This function deletes the information about the service price.
object.Delete
| Part | Attribute | Type | Description |
|---|---|---|---|
object |
Required | The object always implements the
ISServicePrice interface |
Display the information about the service price before and after deleting.
sub main
Dim aFilter
Dim aTrans
Dim aServices
Dim aService
Dim aMessage
Dim aServicePrices
Dim aServicePrice
Dim i, j
Set aTrans = Profile.StartMapTransaction
set aFilter = Profile.CreateServicesFilter
aFilter.Description = "18M DTPH"
set aServices = Profile.LoadServicesByFilter(aFilter)
aMessage = "Information about the service price before deleting: " &_
GetServicesInfo(aServices)
for i = 0 to aServices.Count - 1
set aService = aServices.Item(i)
set aServicePrices = aService.GetServicePrices
for j = aServicePrices.Count - 1 to 0 step -1
aServicePrices.Item(j).Delete
next 'j
next 'i
aTrans.Commit
Set aTrans = Profile.StartMapTransaction
set aServices = Profile.LoadServicesByFilter(aFilter)
aMessage = aMessage & vbNewLine & "Information about the service price after deleting: " &_
GetServicesInfo(aServices)
Profile.MsgBox(aMessage)
end sub
function GetServicesInfo(aServices)
Dim aInfo
Dim aService
Dim aServicePrice, aServicePrices
Dim i, j
aInfo = ""
for i = 0 to aServices.Count - 1
set aService = aServices.Item(i)
aInfo = aInfo & vbNewLine & "Service Code: " & aService.Code
set aServicePrices = aService.GetServicePrices
for j = aServicePrices.Count - 1 to 0 step -1
set aServicePrice = aServicePrices.Item(j)
aInfo = aInfo & vbNewLine & "-----------------------------" & vbNewLine &_
"Agency Code: " & aServicePrice.AgencyCode & vbNewLine &_
"Amount: " & aServicePrice.Amount & vbNewLine &_
"Custom Fee Per Unit: " & aServicePrice.CustomFeePerUnit & vbNewLine &_
"Default Quantity: " & aServicePrice.DefaultQuantity & vbNewLine &_
"Start Date: " & aServicePrice.StartDate & vbNewLine &_
"End Date: " & aServicePrice.EndDate & vbNewLine &_
"Distance: " & aServicePrice.Distance & vbNewLine
next 'j
next 'i
GetServicesInfo = aInfo
end function In Profile Client v8 on User Interface the information about Service Price can be found and deleted in .