How does the SETTING functionality actually work

Is it permanantely stored, or does it always reset after a work period/reboot?

Asking because ive just created a department change depending on time, and it uses SETTING and Trigger… example

7am Trigger makes {SETTING:bar} to AM
7pm Trigger makes {SETTING:bar} to PM

then department changes depending on what that setting is set to on User login

Just wondering if I close the work period today, do the triggers still activate, or even will the Settings still have either AM or PM in them?

Cheers

Matt

Global Settings are permanently stored. Local Settings are lost when you shut down SambaPOS. You can delete both types of settings by using “Update Setting” action with “Delete” parameter enabled from “Update Type”.

For V5 reading a local setting with {LOCAL SETTING:x} tag and reading a global setting with {GLOBAL SETTING:x} is more efficient.

Using {CSETTING:x} greatly improves speed for global settings. It reads value once from database and does not read anymore until cache cleared. Useful if you have settings does not change too frequently.

4 Likes

ooh, new to me that.

ill change some bits

thanks

matt

can I just confirm, if I set a {GLOBAL SETTING:} it can still be read using {LOCAL SETTING:} and {:CSETTING} and {:SETTING}

cheers

Matt

Global settings are stored in DB, local in cache.
Global are indefinite, local are cleared either with pc restart - posibly samba restart.
Specifying global or local as far as I understand should be specific but I believe just {SETTING:XXX} checks local first before global for matching setting name. Emre may correct this but that’s my understanding.
Never seen csetting

  • {GLOBAL SETTING} reads global settings.
  • {LOCAL SETTING} reads local settings.
  • {SETTING} and {CSETTING} reads both. However they are slower as they need to scan settings to determine if they are local or global.

Global settings are stored on database so accessible from other terminals. Global settings are persistent. Does not gets lost until they are deleted.

Local settings stored in local application memory. Not accessible from other terminals. Got lost when SambaPOS restarts.

3 Likes

Excellent thanks.

This has created a whole new ball game for me… my head is going wild with ideas lol.

Just got to do some edits in my latest screen switching system.

Thanks for the help appreciate it

Matt

Program serttings seemed like the greatest thing when first cracked the principle but see them get used for allot of things that would be more suitable as say a ticket state or tag and entity state or custom field or even ‘live’ with a good report expression.

Two things I have which are good examples of each are;
Last ticket ID for print last bill. As a local setting so per terminal reprint option. I like this one as worked state mappings for normal print bill and print last bill so the two buttons fill the sale position with print last available untill a ticket is opened then it prints that current ticket.
On my origional hold ticket setup I used global program settings using username and increasing/decreasing as tickets are put on hold/opened, using global so count is maintained over all tills. This has since been replaced with a report expression to check for ticket state of hold with state value of that username so on login it prompts them to remind them they have tickets on hold.

1 Like

so in my screen change dependant on time, ive changed it all to, for example, {GLOBAL SETTING:bar} from {SETTING:bar} and set the ‘is local’ to false in the setting action.

But it doesn’t display anything, I have a button that should toggle but its blank… and with the setting not working it makes a few other things not work ive set up…
am I using it right?

do I need {GLOBAL SETTING} if I changed the ‘is local’ to false?

Matt

Sorry I couldn’t understand what you are asking. {SETTING} will work for all types of settings.

yep, my bad… I set all constraints so that it was impossible for me to set the first {SETTING} and so then everything else wasn’t working… doh

Whoops :smiley: