Adding Items Through QSRules

Nov 22, 2005 2 Replies

Any advice on using QSrules session object to add item to POS screen? Code snippets would be very much appreciated. Thank you,


Public Function Process(mySession As Object) As Boolean Dim objAdded As Object Dim id as Long Dim ilc as String objAdded = mySession.Transaction.Entries.Add(id, ilc, 1, 0, False, 0) SendKeys ("{Down}") 'I throw this in there because I haven't figured out how to refresh the transaction screen and also because it puts the focus on the next transaction line. Maybe someone can pipe in with a solution Process = True End Function

I think you need to set the CurrentEntryKey Transaction.CurrentEntryKey Property (Let) The Let CurrentEntryKey property sets the transaction entry with the specified key as the current entry.

Public Property Let CurrentEntryKey( _

ByVal Value As String _

)

Parameters Value

String that contains the new value to set as the current entry key. You can set this property to a key that does not exist in the transaction, but an attempt to retrieve an entry with an invalid key will return a null reference.

Remarks Transaction entry keys are assigned sequentially as string representations of integers. For example, the third entry added to the transaction is assigned the entry key "3". These keys are unique for the duration of the transaction; if the entry with the key "1" is deleted, the key "1" will not be reused.

Example The following example shows how to set the current TransactionEntry object to the first entry that was added to the transaction. The example ensures that the entry exists before changing the property value; if an entry with the specified key does not exist, the value of the CurrentEntryKey value will not be changed.

Visual Basic 6.0 Example

Public Sub SetCurrentEntry(Session As QSRules.SessionClass, _

NewValue As String)

If Not Session.Transaction.Entries(NewValue) Is Nothing Then

Session.Transaction.CurrentEntryKey = NewValue

End If

End Sub

Rob

That's great - thanks for the reply, I'll work on this....

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required