📚 SAP Business One SDK Help

AddAlertManagement Method
See Also  Example
pAlertManagement

Specifies the required AlertManagement.

Description

Creates new instance of AlertManagementParams (Code, Name and Type) Object that match the input parameter AlertManagement.

Syntax

Visual Basic
Public Function AddAlertManagement( _
   ByVal pAlertManagement As AlertManagement _
) As AlertManagementParams

Parameters

pAlertManagement

Specifies the required AlertManagement.

Example

Add a user alert
AddAlertManagement (Visual Basic)Copy Code
'get alert
Dim oAlertManagement As AlertManagement
Dim oAlertManagementParams As AlertManagementParams
Dim oAlertManagementRecipients As AlertManagementRecipients
Dim oAlertRecipient As AlertManagementRecipient

'Assuming that oAlertManagementService is already defined!

'Get alert
oAlertManagement =
oAlertManagementService.GetDataInterface(AlertManagementServiceDataInterfaces.atsdiAlertManagement)

'set alert name
oAlertManagement.Name = Alert1

'set query
oAlertManagement.QueryID = 34

'activate the alert
oAlertManagement.Active = BoYesNoEnum.tYES

'set priority
oAlertManagement .Priority = AlertManagementPriorityEnum.atp_High

'Set the Frequency
oAlertManagement .FrequencyInterval = 1

' set the Frequency type to hours
oAlertManagement.FrequencyType = AlertManagementFrequencyType.atfi_Hours

'get Recipients collection
oAlertManagementRecipients = oAlertManagement.AlertManagementRecipients

'add recipient
oAlertRecipient = oAlertManagementRecipients.Add()

'set recipient code(manager=1)
oAlertRecipient.UserCode = 1

'set internal message
oAlertRecipient.SendInternal = BoYesNoEnum.tYES

'add alert
oAlertManagementParams=oAlertManagementService. AddAlertManagement (oAlertManagement )

See Also