Ok I seem to be stuck once again. I need to get a value from a dialog field into a variable so it can be written to an external table. My code to write to the external table is in an on-click button on the dialog window, in the server-side XB. The code I have writes to the proper table correctly except I need to get the value from a field that is bound to the dialog into a variable to write to the external table.
I have tried the code: var eventid = "{dialog.object}.getValue('event_id');" but this doesn't seem to work. I tried putting it in the server side events as well under ondialoginitialize with no luck.
Now the event_id field on the dialog is populated upon opening. Maybe my logic is wrong, or maybe someone can show me how to write that field to the external db.
Below is my code to write to the external table.
var eventid = "{dialog.object}.getValue('event_id');"
dim tbl as p
tbl = table.open("link_table")
tbl.enter_begin()
tbl.Person_Id = session.userid
tbl.Event_Id = eventid
tbl.enter_end(.t.)
tbl.close()
My dialog is linked to my events table, with the Event_Id field, and other fields in the dialog. I am taking the Event_Id and the logged on user and writing to the link_table. The userid is getting written correctly, and the event id is not getting the correct event_id, it is just writing 0 to the table instead of the correct id # no matter what event is selected. The event_id shows correctly on the dialog.
Thanks for the help.
I have tried the code: var eventid = "{dialog.object}.getValue('event_id');" but this doesn't seem to work. I tried putting it in the server side events as well under ondialoginitialize with no luck.
Now the event_id field on the dialog is populated upon opening. Maybe my logic is wrong, or maybe someone can show me how to write that field to the external db.
Below is my code to write to the external table.
var eventid = "{dialog.object}.getValue('event_id');"
dim tbl as p
tbl = table.open("link_table")
tbl.enter_begin()
tbl.Person_Id = session.userid
tbl.Event_Id = eventid
tbl.enter_end(.t.)
tbl.close()
My dialog is linked to my events table, with the Event_Id field, and other fields in the dialog. I am taking the Event_Id and the logged on user and writing to the link_table. The userid is getting written correctly, and the event id is not getting the correct event_id, it is just writing 0 to the table instead of the correct id # no matter what event is selected. The event_id shows correctly on the dialog.
Thanks for the help.
Comment