This tip is to handle the scenario where the user needs to extract the transaction details from some text file or other source and show them on POS Transaction screen programmatically from RMS custom POS Add-Ins.
Suppose the user has retrieved all the required values to be populated on transaction screen then by using the following code snippet the records can be populated on it.
The required values to be displayed for a transaction are: Item ID, Item Description, Price, QtyPurchased, comment etc.
First need to find the maximum transaction entry number, which will get inserted into the tables after the tender is done for this transaction in the RMS system.
Then use an object of Session class. Here in the code snippet it is currSession.
Following is the code snippet for populating a record in Transaction screen with a set of required values.
– This code has been written inside the Process() method of Class Library.
– So on click of POS button will invoke this method and a record will get displayed on the Transaction Screen.
[VB.Net code Start]
Public Function Process(ByVal currSession As Object) As Boolean
Dim AmountValue As Double = 100.0
Dim QtyVal As Double = 10.0
Dim ItemLookUpCode As String = "44576572"
Dim ItemDesc As String = "Transaction Record"
Dim ItemId As Integer = 1111
Dim maxTrasnEntryNumber As Integer = currSession.Transaction.Entries.Count + 1
' Writing to the transaction screen
currSession.Transaction.CurrentEntryKey = maxTrasnEntryNumber
currSession.Transaction.Entries.Add(ItemId, ItemDesc, 1, 0, False, AmountValue)
SetPrice(Format(AmountValue, "0.000"), False, True)
currSession.Transaction.Entries.Element(maxTrasnEntryNumber).Comment = "Testcomment"