We'd have to see the script your button performs. Generally, a button on a portal row will do exactly what you describe without trouble since clicking the button makes that row in the portal the current row. (You do see the button on every row of the portal don't you?)
There are other ways to auto-fill in default values that do not require scripts. Why do you need a script for this?
The reason for autofill script is that its for an expense sheet. Its just a convience thing, and not every one of the selected fields needs to be flled in for every day.
But ya got me thinking. Found my error. Was jumping around layouts. (had just solved the reason for the need to; setting variables) but hadn't pulled it from the script.
(I wish there was a way to cut-n-paste scripts here. is there? I tried it with textedit, but nothing)
"I wish there was a way to cut-n-paste scripts here. is there?"
I know of two methods:
- Print the script to a PDF and copy and paste the text from the PDF.
- If you have FMP advanced, create a database design report and copy the script text from the design report.
I've tried the PDF, but each command is a seperate page.
I do have advanced, will look into it. (the report should help a LOT with getting rid old scripts, I hope. as well as other fun stuff)
The DDR has its flaws, but even so is extremely useful. The debugger also is well worth the extra $$.