mig28mx
28th August 2008, 02:04
Hello all,
I´m facing the following problem:
I have a form 3 to update a table. And in that form I have one button that must be enable when a record on the form is selected.

When no one record in the form is selected and the user press the button, a message must display "Option not allowed".

When one record is selected and the user press the button, another session will called.

I belive is a work for mark.occ, but not sure about it.

Any suggestion?

Thank you in advance.

Ankita
28th August 2008, 06:51
Hi,

A button cannot be enabled or disabled in Baan IV c4. But u can do one thing in choice.user.0 section, u can check that whether record is selected using:
for i=1 to filled.occ
if mark.table(i) then
bool_flag=true
break
endif
endfor

Now, check if bool_flag is true, then u can zoom to another session. Otherwise, u showa message a to user that "Option not allowed". Also, write choice.again to transfer control to program.

mark_h
28th August 2008, 16:15
Or use something like this:

|******************************************************************************
| This is what the Process Selected item button runs
|******************************************************************************
choice.user.2:
on.choice:
if(not marked) then
message("No records selected.")
choice.again()
else
spool.device = ""
process_selected_items()
endif

mig28mx
28th August 2008, 23:03
Thanks Mark & Ankita.
Your solution works perfectly.

Regards.