Simplest way: write a script ...
Enter Find Mode [ no pause ]
Set Field [ target field: Cashbook::currency ; calculated result: Get ( ScriptParameter ) ]
... and create two buttons that each use this script: one with a script parameter of "$", the other one with "€".
Thanks so much. Worked a treat. However when I click the button (to go back
to the data entry page) I need to unsort the records. (show all) ??
If you need to show all records, then do that; but this is distinct from sorting or unsorting them.
Fair enough. but how do I unsort them going back to the entry layout?
but how do I unsort them ...
I'm still not sure how the sort order plays into this, but there is an Unsort Records script step.
Do you mean un-FIND the records or un-SORT the records.
Your found set determines what records are being shown.
Show All Records
is the script step that removes the found set.
Sort Records is a separate script step, usually performed after a found set.
Doing a "show all" will restore the original "unsort", no need to invoke it, but as erolst says, you can call it if you want.
The practical advice is:
• if the found set stays the same, conditions like "keep records in sort order" might fire and re-sort records when you change the contents of a field being part of the "sort by" list.
• if the found set changes, from a specific one to the one you get through a Find all, then there's no sort.
Well it seems that I used the wrong words in my question, which is easy for
a beginner to do!
All records are entered on the first layout, either with a € or $ as
currency. The second and third layouts will show the records in a list (€
or $) via a button (got that to work). When I go back, via a button to the
"entry" layout, I want all the records to be shown. I thought of: "when
button is clicked", go to layout 1 and show all /or unsort /or unfind all
I know I could just click the "show all" button on the Status toolbar but I
do not want the Status Tool bar to be apparent.
OK Done it!
Thanks for everybody's help
1. Write a one line script with the Show All Records as the single script step as Mike suggested
2. On layout 1, enter the layout setup, go to the script triggers tab, select the "OnLayoutEnter" trigger, and set the script to the name of the script created in step 1.
I did it by making the script for the button back to layout 1
Any layouts that share the same table occurrence name in layout setup also share the same found set, current record, sort order... for a given window.
And that last phrase points out another way we can handle this type of issue. Instead of just changing layout to find these records, sometimes it makes sense to open a new window, change layouts and find the records. Then we can just close the window to return and when we do, the layout is left exactly as we left it, The focus and found set details will be unchanged.
Thank you philmodjunk. I see the logic there. Can you give me the script steps to do this. What I did just came back to the original (now sorted) layout). If I duplicate the layout it still shows the records.
I've now created my vacation booking side. On the "cash" side all the entry layouts are done. Now trying to finish it with these reports.
Confession: Only got the FMP trial on the 15th December and purchased it on the 28th! New to FMP but had used databases on and off.
Thank you all. I seem to have got it working now with a combination of your aid.
I really must say a big thank you to all of you who help us newbies. I'd never be able to complete these databases if all I had was the FMP manuals.