Setting POS Template Variables?

In the customization guide under POS Template Variables, There are user variables listed as Session.Variable1 to Session.Variable10. How does one set these? How long is a Session? That is, Does one need to reset them if we want them to apply to each transaction?

Newbie Developer to RMS

Reply to
Jewelsmith
Loading thread data ...

Hi Jewelsmith, Nice question, I also would like to know the usage of session variable..

CP.D> In the customization guide under POS Template Variables, There are user

Reply to
C.P.Dinesh

Hi Jewelsmith.. I can reply to your question.. You can set the value through qsrules or qsbridge, and the value is available until to close POS.

I have com objects that use Session.Variable(1) how flag..

Start POS - Object0 -> START POS / NEW TRANSACTION Reset value Session.Variable(1) = 1 (no invoice, only fiscal receipt)

- Object1 -> TENDER END / BEFORE TO PRINT RECEIPT

If Session.Variable(1) = 1 DISABLE RECEIPT PRINTER 1 Else Enable Receipt Printer 1 and add new invoice to journal (progressive number/invoice type/year)

Variable(2) -> new progressive number Variable(3) -> Document Type (DDT, INVOICE or other)

- Object2 -> FISCAL PRINT If Session.Variable(1) = 1 PRINT FISCAL DOCUMENT Else Nothing

- Object3 -> (XML Parser) (only when object1 enable printer1) Replace statement Session.Variable2 and Session.Variable3

- New Transaction (object0)

sorry for my example..

Reply to
Antonio Mazzeo

Reply to
C.P.Dinesh

Hi Antonio,

I appreciate that you posted an example of how to use Session.Variable. However, the example demoed only how to store primitive values such as integer to the variable collection. Do you know if it is possible to store objects of a custom class to the Variable? I guess that the Variable keeps the references to objects only, so I tried to declare Shared member (in VB) (or static in C#) in a class to make it persistent, however, I found that Session.Variable failed to keep the objects persistent among addin components. I wonder how one could transfer objects from one addin to another. Please advise.

Reply to
lzcouponex

No ... this is not possible .. because when you set a NON-PRIMITIVE value into session object.. the system copy only a reference value.. and the reference value contain the virtual-address of your object in the current instance of object.. and when the system remove your add-on from memory.. remove data from memory.. and in new instance the object is un-initialized. If you need to store a custom-class you can try to by-pass the problem through external object (example.. dcom... persistence object with xml ...)

bye antonio

Reply to
Antonio Mazzeo

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.