I have a PurchaseOrders table that looks like this:

poid (pk, autoinc)
posuppid (references suppliers.suppid)
potoal (currency)

Dragging that table to a form section gives me the fields, now I don’t want the user to capture posuppid as this is already known so I want to fill this with a valid supplier id, say ‘2’.
The first approach I tried was to leave the posuppid field on the form and set it like this:

loSec = Lianja.get("Purchase_Orders.section1")          

        lfFld = Lianja.get("Purchase_Orders.section1.field5")
        lfFld.value = 2

All looks ok onscreen until I save, then posuppid is set to 0 and the record is saved without the value being set.
So my question is – what is the best way to update a field like this, should I maybe be setting it directly on the table and not on-screen,
UI controls are bound to a data source. Changing the data source and refreshing the control it is bound to should be done.
Programmatically updating the UI control does not update the data source.

replace purchase_orders.posuppid with 2
Lianja.getElementByID(" eld5").refresh()

You have to select the correct cursor first.
If you select a cursor save the active one first and restore it afterwards. See SELECT and SELECT()

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.