Creating a List with Custom Buttons (Version 15 & above)

Locked
COBS Tech Support
Site Admin
Posts: 124
Joined: Sat May 15, 2021 9:57 am

Creating a List with Custom Buttons (Version 15 & above)

Post by COBS Tech Support »

This script presents a list based on the day's sales orders, with three custom buttons.

Code: Select all

OpenTable("ORDERS", "MYORDERS", TRUE)
MYORDERS->(FilterTable("ODATE=CTOD('" + DTOC(Today()) + "')"))

Declare aBtns Type Array
aBtns := {}
ArrayAdd(aBtns, "Button 1...")
ArrayAdd(aBtns, "Button 2...")
ArrayAdd(aBtns, "Button 3...")

LookUp("MYORDERS",, 1, "Today's Orders",,, "OrderBtnScript", aBtns)

CloseTable("MYORDERS")
Which displays this grid:

Image

This is the list's management script which reports which custom button was pressed when pressed:

Code: Select all

* OrderBtnScript
* User button Pressed
If Mode > 9 .And. Mode < 21
   Echo("Button number press: " + NTrim(Mode - 9))
Endif
Locked