You are using Perform Find/Replace instead of Perform Find.
1. You should be using script variables (or script parameter) instead of Copy, and Set Field instead of Paste. Leave the clipboard to the users.
2. The Go to Related Record  step can do all of your steps 1 - 6 at once.
3. Your step 8 is not necessary - certainly not at the end of a script.
Thanks. The Go to Related Record step now does what I want, though I added two steps: Sort Records and Go to Record/Request/Page.
Although the script works well on the desktop, I'd like it also to work via a browser. Although FMP Help says all steps are web-compatible, I don't get the desired result when I try it in a browser window. The screen refreshes, and a progress bar appears to show activity to quick completion, but the layout view is unchanged.
What might I be overlooking?
Thank you for your posts.
I don't know what you are overlooking. This is what I have done...
1. I created a two test tables (MASTER and LOOKUP), with a common key field "ID".
2. I added a few records to LOOKUP with two different ID's (1 and 2)
3. In my MASTER layout, I created a portal into LOOKUP that included some fields.
4. In the MASTER layout, I enter ID: 1 and three records display in the portal.
5. I created a script "Go To Related Record", with the script step:
Go to Related Record [ Show only related records ; From table: "LOOKUP" ; Using layout: "LOOKUP" ( LOOKUP ) ]
6. I create a rectangle button that executes the script "Go To Related Record".
7. In Browse Mode, I click the button, and the script takes me to the three related records in the layout "LOOKUP".
8. I turn on Instant Web Publishing and set access for the file to all users.
9. I go to another machine, launch a browser, enter the IP Address of the host machine, and select the file from the Instant Web Publishing page.
10. I go to the MASTER layout, display the record with ID: 1, click the button, and I switch to the LOOKUP layout where the three related records are displayed.
Please let me know what I'm doing differently than you, and I'll try to duplicate the problem here.
A word of background: I maintain and host this non-profit database on my home PC. A volunteer colleague works with me, accessing the file remotely via Instant Web Publishing. Periodically I do the same from another machine of my own, usually to test, troubleshoot, or verify normal IWP operation. It appears that your procedure and mine are much the same.
I suspect the script steps are not at fault, since the script delivers the desired results on the host PC. The three steps are:
1. Go to Related Record [Show only related records; From table: “Donations”; Using layout: “Donation Data Entry” (Donations)]
2. Sort Records [Restore; No dialog]
3. Go to Record/Request/Page [Last]
My Contacts layout also includes a portal that displays data from the related Donation records. Related record data do show in the portal when viewing via IWP.
Re your steps 8-9, my IWP is always on. Access is limited to specific users and privileges.
As mentioned earlier, when I push the script button on the IWP layout, the screen refreshes and a progress bar appears briefly, but I still end up looking at the Contact record. I wondered if, somehow, the related Donation records had been found and sorted anyway, but not displayed. Going manually to the Donations layout, after running the script, shows that has not happened.
Thanks for the update.
The progress bar is displaying probably because of the sort.
My first thought is that the access privileges do not allow access to the "Donation Data Entry" layout. One way to check this is to disable the last two steps and just see if you can switch to that layout. If this works, then add the sorting step next, and try again. Finally, add the last step.
Please continue to keep me updated.
TSGal said: My first thought is that the access privileges do not allow access to the "Donation Data Entry" layout.
You were right. I was using an IWP login that (as a test) had been denied access to the Donation Data Entry layout. Mea culpa, apologies, and thanks.
My next challenge is to create a script that can be executed (from a Contacts record) to open a new, related Donations record. Easy to do with a portal entry, but I'd prefer to use a button. The path is not clear, so I may have to make it the subject of a new post.