JariV Posted January 28, 2008 Posted January 28, 2008 Hi, I'm just in the process of learning to use IWP. I'm stuck with a script that does not want to work in IWP, but produces an error: "FM Web Publishing: Web Scripting Error: 101, File: "Main", Script: "SetUpData", Script Step: "Go to Portal Row" The script navigates to a correct layout, where there is just one portal with existing related records (simple one-to-one relationship) and then it should loop through portal rows and copy a set of related field values into a global field. The script has a following structure: Allow User Abort [Off] Go To Layout ["Layout_5] Set Field [Main::gTemp;""] Commit Records/Requests [No dialog] Go To Portal Row [First] Loop Set Field [Main::gTemp;Main::gTemp & Sub::Field_1] Go To Portal Row [Next; Exit after last] End Loop Commit Records/Requests [No dialog] Go To Layout [Layout_1] In FMPro the script works as it should, but in IWP it doesn't. Any ideas where the problem might be? Jari V
Breezer Posted January 28, 2008 Posted January 28, 2008 is "Main" a separate file or just a TABLE? If it is a separate file, then that file "Main" should also have it's IWP turned on.
JariV Posted January 28, 2008 Author Posted January 28, 2008 Main and Sub are separate files. Both files have IWP on, also the account privileges in both files allow access via IWP.
Breezer Posted January 28, 2008 Posted January 28, 2008 Try to commit the record after the set Field because it could be the record has not yet submitted hence "record is missing" Allow User Abort [Off] Go To Layout ["Layout_5] Set Field [Main::gTemp;""] Commit Records/Requests [No dialog] Go To Portal Row [First] Loop Set Field [Main::gTemp;Main::gTemp & Sub::Field_1] Commit Records/Requests [No dialog] Go To Portal Row [Next; Exit after last] End Loop Commit Records/Requests [No dialog] Go To Layout [Layout_1]
JariV Posted January 28, 2008 Author Posted January 28, 2008 Thanks for the suggestion. A problem with committing a record inside a Go To Portal Row [Next, Exit after last]-loop is that after committing the script "forgets" the current active row, and the loop gets permanently stuck in the first portal row. I can't see any other way to try this, but to make some other kind of portal row navigation counter, I'll try that to see if committing solves the original problem. Jari V
JariV Posted February 1, 2008 Author Posted February 1, 2008 Just to follow up - committing the record after Set Field solved the original problem, thanks. The subsequent problem of Go To Portal Row [Next; Exit after last]-loop forgetting its row after Commit Records was easily fixed with a calculation based looping counter. Jari V
Recommended Posts
This topic is 6408 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now