View Full Version : buttons don't work after moving from v8->v9


03-29-2008, 10:47 AM
Title should read "Buttons don't work:)"

When i moved my db from v8 to v9 some of my buttons quit working.

The buttons use action scripting to open other forms. I have one form where 6 buttons are now not working.

Here is the xbasic for the action scripts on one button:

'*******************************this part is in an inline xbasic action script
dim global name as c
name = topparent:full_name.value

'************************************this part is an action script
'Check to see if you are running the script from within a Form
dim flag_error as l
flag_error = .f.
if is_object(topparent.this) then
p = topparent.this

if eval_valid("P:Client_id.value") then
DELETE Parameter1
'Set the Parameter variable to the object's .value property
Parameter1 = eval("P:Client_id.value")
flag_error = .t.
end if
flag_error = .t.
end if

if flag_error then
ui_msg_box("Error","Client_id does not exist. This script cannot be run in this context.",UI_STOP_SYMBOL)
end if

filter = "Client_id = [varC->parameter1]"
query.filter = replace_parameters(filter,local_variables())
query.order = ""

'Open the layout_type showing just the records that satisfy the filter
DIM Shared varP_Bodyfat as P
DIM layout_name as c
layout_name = "height"
varP_Bodyfat = :Form.viewqueried(layout_name,query.filter, query.order ,"dialog","Center","Center")
'After the user closes the dialog form, the form remains in memory and the script
'continues with the next command.
'You can insert any code here that you want to execute before the dialog form (which is now
'hidden) is removed from memory with the .close() command.
'The code that you insert here can refer to the form using the pointer variable, varP_Bodyfat

if is_object(varP_Bodyfat) = .t. then
end if

Since it is action scripting and not 'home made" xbasic I do not see why it does not work in v9 but is fine in v8.
Thanks for the help

03-29-2008, 11:04 AM
Here is another code that is not working:

dim global new_image as c
dim global client_id as c
client_id = topparent:client_id.value

new_image = topparent:image1.value
DIM Shared varP_Add_Image as P
DIM layout_name as c
layout_name = "Add Image"
varP_Add_Image = :Form.load(layout_name,"dialog","","Center","Center")

This is from an action script as well.

Selwyn Rabins
03-29-2008, 02:40 PM
What happens? Do you get an error, or does nothing happen?

The code in your example is pretty simple. You can go to the interactive window in alphasports and test simplar code. On my machine, this works fine. Does it work on your?

p = form.load("Edit_Customer_Info","dialog","","center","center")

03-29-2008, 02:48 PM
In v9 it did nothing. in v8 it worked fine...open/filter/sort form.

I deleted the action scripts that were not working and replaced them with some custom xbasic and it works.


03-29-2008, 04:37 PM
I have the same problem with a button on my for that was created in v8 to open another form.When I press the button in version 9 I get the fly over effect when the mouse passes over and a brief hourglass when pressed and then nothing. It still works in version 8.
The button was created with action scripting "open form"
I have uploaded the database.
look at the "View/Edit Selected jobsheet" Button

From the Main Menu Press button View customerjobsheet information
then go to the jobsheet summary "Tab"
select a jobsheet from the browse and then press the "View/Edit Selected jobsheet".
Must have something to do with the browse?

03-29-2008, 04:59 PM
Sounds very similar.

Selwyn Rabins
03-29-2008, 05:44 PM
Thanks for the sample database.

I was able to duplicate the problem. It is fixed now. I will put out an update tomorrow morning.

there was a typo in some code in form.viewQueried() that would cause it to fail if using V9 and if the form was based on a set. if the form is based on a table, then .viewQueried() is working fine.