Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripting for buttons

Status
Not open for further replies.

kboyer2006

Technical User
Aug 1, 2006
3
US
At work I've created a form in table layout in FM 7 for ordering lab products in my dept. My boss wants a button next to each item so that if the docs want to order that product, they can just press the button next to the items and it will automatically be sent to the network printer of the person who does the ordering. Now in the layout, there's a header with the case#, date, charge and the name of doc who's ordering. The footer has any comments that the doc wants to add. So, actually, I need the entire form printed with the items checked off. BTW, my boss says he wants it by this Friday and today is Tuesday!

For several days, I've been trying to figure out how to do this. I created the button in the layout field, but when I go back to browse or find mode, the button doesn't show. So, needless to say, even if I put in a script for it to print to my printer, because the button disappears, nothing works.

Someone please help!!!!
 
In which part of your layout did you put the button ?
 
I was trying to put the button right next to the code field. The layout is in table view. Does it matter what view the layout is in? Should it be in form view? I put it in layout view because there are approximately 30-40 products the docs must select from and it was just easier to have to have it in this view so that they could see all the products in one glance. (Suggested by my boss seeing that most of the docs that will be using this are not PC friendly) After reading a little while waiting for response, I realized I may just need a check box instead of a radio button.
 
With 'part' I mean: header, body, footer.

You're mixing up terms (like 'layout field), so it is hard to find out what's going on here.

When you in 'layout mode', you can see which parts you have on the given layout; header, footer, body, trailing summary etc. Buttons don't worj in every part of a layout. (see help file)

It's not very clear to me why you want to put needed information in a header or footer part.

A radiobutton will give you an 'or' choice, a checkbox will give you a singular or multichoice (return separated list), which is an 'and' choice.

If I understand you well, I would give the user a layout where choices can be made for product, with the possibility for name, date etc.
If there are sub-choice, use a filtered valuelist.
After that the user can click on a button which will trigger the script to summarize all the choices and generate a report (print) that is redirect to a printer.
 
Jean,

I need help with the body of the form. The header is fine; they just fill in pertinent info about who's ordering. The footer - the same. However, the ordering items are in the body of the form in a "table" view. I need to put a check box next to each item so the docs can choose which item they need to order. I can't figure out how to make a check box in FM.
 
First it's best to have a valuelist linked to a button formatted field.

The valuelist can be a custom made, you fill in the values in: File --> Define --> Valuelist.
Here you have the choices: use values from field (point to a field - the values in that field in the given table will be listed in the valuelist in your table)
use valuelist from another file (seems to be clear)
custom values : your list of items.

As I mentioned above, you format a field as...
In layoutmode, click on the field you want to attach the valuelist to, Format --> Field/Control --> Setup
In this window: Display as --> make our choice from the drop menu, this time Check box --> Display values from: --> make a choice from the valuelists.
Back in layoutmode, make sure the fielddimentions are set to show all the values, and make sure the bordercolor is not set to the background color or you will not see the boxes.

Now this is how to make a checkbox.
The use of a checkbox is another story.
You can use a checkbox to let the user make a choice out of a given list, or just to make a choice, like Yes or No.
If it is the latter, with, f.i. a script that will look at the Yes/No value checked, you can make If() statements an steer the application in every which way you want.

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top