Howdy All,
I'm writing an extension that needs to locate and modify an existing transaction in a ticker. The transaction to be located should be ...
1) The very last transaction (most recent date) that was entered
2) For only ONE share
My existing code ...
Set TransactionRecs = ticker.Transactions
If TransactionRecs.Item(TransactionRecs.Count).GetProperty("Shares") = 1 Then
Set OneTransaction = TransactionRecs.Item(TransactionRecs.Count)
OneTransaction.SetProperty "Date", G_EntryDate
OneTransaction.SetProperty "Price", HistoryPrice
ticker.ApplyTransactionToCurrentHoldings(OneTransaction)
End If
... does NOT update the existing entry in the "Current Position" listing, as displayed in the Transactions tab of the Properties dialog box. Rather, the code ADDS an entry into the "Current Position" listing (see Image1.jpg). However, the correct entry in the "Transaction History" listing IS updated correctly.
What is the code necessary to MODIFY the existing entry in the "Current Position" listing, instead of having a new entry ADDED?
Thank you,
-Don

Image1.jpg