📚 SAP Business One SDK Help

UpdateAlertManagement Method
See Also  Example
pIAlertManagement

Specifies the target ApprovalTemplate.

Description

Update this ApprovalTemplate by another ApprovalTemplate.

Syntax

Visual Basic
Public Sub UpdateAlertManagement( _
   ByVal pIAlertManagement As AlertManagement _
) 

Parameters

pIAlertManagement

Specifies the target ApprovalTemplate.

Example

Update a system alert
UpdateAlertManagement (Visual Basic)Copy Code
Dim oAlertManagement As AlertManagement
Dim AlertManagementParams As AlertManagementParams
Dim OAlertManagementRecipients As AlertManagementRecipients
Dim oAlertRecipient As AlertManagementRecipient
Dim j As Integer

'Assuming that oAlertManagementService is already defined!

'get alert params
AlertManagementParams = oAlertManagementService.GetDataInterface(AlertManagementServiceDataInterfaces.atsdiAlertManagementParams)

'set system alert code
AlertManagementParams.Code = -5

'get alert
oAlertManagement = oAlertManagementService.GetAlertManagement(AlertManagementParams)

oAlertManagement.Active = BoYesNoEnum.tYES

'set % Discount
oAlertManagement.Param = 15

'set priority
oAlertManagement.Priority = AlertManagementPriorityEnum.atp_High

'choose Quotation document
For j = 0 To oAlertManagement.AlertManagementDocuments.Count - 1
    If oAlertManagement.AlertManagementDocuments.Item(j).Document = AlertManagementDocumentEnum.atd_Quotations Then
        oAlertManagement.AlertManagementDocuments.Item(j).Active =BoYesNoEnum.tYES
        Exit For
    End If
Next j

'get recipient collection
OAlertManagementRecipients = oAlertManagement.AlertManagementRecipients

'add recipient
oAlertRecipient = oAlertManagementRecipients.Add()

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

'set internal message
oAlertRecipient.SendInternal = BoYesNoEnum.tYES

'update system alert
Call oAlertManagementService.UpdateAlertManagement(oAlertManagement)

See Also