Source Code: ProgramSet.cpp See also system() PosCommand
Execution
Source Ref: ProgramSet::ExecuteUserCode()
- If the setting QuickCodeAllowRemote is set (default yes) and the quickcode value matches the pattern Fnnnn, then
call ExecuteRemoteCode first. Remote quickcodes are reserved for Fieldpine Support. Quickcodes are defined on Fieldpine servers
in the file Gds2\RmWebQuickCodes\main.txt
- A call packet is built to call retailmaxweb.rmpos.quickcode Various pieces of system identifying information are included (licence#, version, MAC etc)
- If the code is a known code (f5001 etc), details about DLL and EXE files is included in the call.
- The call packet is sent to the remote server and we wait for the response.
- The response packet is processed. The server can provide the following types of commands
- PosCommands (executed immediately). Sent as "150"
- PosScript. (buffered to end). Sent as "151"
- FdlCommands. (executed immediately). Sent as "152". FdlCommands are a restricted subset of commands, see source for details.
- Values to append to fpos.ctl. (buffered to end). Sent as "153"
- Remote "C" code. (executes "161" lines immediately). Sent as "160"
- Remote "C" code define. (buffered to "160" received). Sent as "161"
- Open browser to Raw HTML. (executes "171" lines now). Sent as "170"
- Raw HTML define. (buffered until "170" received). Sent as "171"
You can manually see the response sent for a quickcode by browsing to
http://www.fieldpine.com/gnap/M/buck?3=retailmaxweb.rmpos.quickcode&100=f123
- The files posmetadef.txt, fieldpine-support.txt, posmetadef_user.txt and customer-support.txt are processed in turn
until the first file executes the code.
- The file is read and the command extracted. This involves searching for lines starting with
QUICKC(xxx) command
and matching xxx to the requested quickcode. - Security checking is disabled briefly while the quickcode is executed. This is reasonably safe as only commands inside the files will be executed.
- The command string is passed to the general PosCommands execution processor.
- The file is read and the command extracted. This involves searching for lines starting with
- A quickcode executed event is logged
- If the quickcode was not executed, the user is given an error message.