Syntax
Public Function DeleteClosedPosition(AccountID As Integer, TicketID As Integer) As CallingResultsEnum
Description
This function is used to delete the closed position for a specific account number. After DeleteClosedPosition method executes, DeleteClosedPositionResultRecevied event fires.
Parameters
Parameter |
Description |
AccountID |
Account number to delete closed position for. Value type is Integer. |
TicketID |
Ticket number to be deleted. Value type is Integer. |
Return value
Returns value of type CallingResultsEnum. If the request was sent to the server successfully, it will return SuccessResult.
Sample
Private Sub GetHistory_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GetHistory.Click
‘BOAPI is predefined variable as CVertexBOAPI
Dim Result as CallingResultsEnum
Dim vAccount As COAccount
Dim vClient as COClient
Dim AccountID as Integer
vClient = BOAPI.ClientByIndex (1)
vAccount = BOAPI.AccountByIndex (vClient.ClientID, 1)
AccountID = vAccount.AccountID
Result = BOAPI.GetAccountHistory (AccountID,-1,””,””)
MsgBox (Result)
End Sub
Private Sub BOAPI_AccountHistoryReceived (ByRef AccountHistory As VBA.Collection) Handles BOAPI.AccountHistoryReceived
Dim vAccount As COAccount
Dim vClient as COClient
Dim AccountID as Integer
vClient = BOAPI.ClientByIndex (1)
vAccount = BOAPI.AccountByIndex (vClient.ClientID, 1)
AccountID = vAccount.AccountID
Dim TicketID as Integer = AccountHistory.Item (1).Ticket
IF AccountHistory.Item (1).HisType = “2” then ‘closed Position
Dim Result as CallingResultsEnum
Result = BOAPI.DeleteClosedPosition (AccountID, TicketID)
MsgBox (Result)
End IF
End Sub
See Also
VertexFX Backoffice API Index
|