john9210 Posted October 18, 2015 Posted October 18, 2015 FM 12 Adv. When I run the following script, it produces the error message “This script cannot be found or has been deleted” when it reaches the Go to Layout step. After I click ok, the script continues, finding and sorting the correct set of records. Enter Browse Mode Set Variable [ $$Issue; Value:VisitNotes::gIssue ] Go to Layout [ “Issue Report” (VisitNotes) ] Enter Find Mode [ ] Set Field [ VisitNotes::Issue; $$Issue ] Perform Find [ ] Sort Records [ Keep records in sorted order; Specified Sort Order: VisitNotes::VisitDate; descending ] [ Restore; No dialog ] Go to Record/Request/Page [ First ] I can’t figure out why the message appears.
comment Posted October 18, 2015 Posted October 18, 2015 Does the layout setup have a script triggered OnLayoutEnter?
LaRetta Posted October 19, 2015 Posted October 19, 2015 Hi John, Aside from your error message, which I believe Comment is handling perfectly, a few other things caught my eye: Why set the variable? It appears that the user enters their request into a global field called gIssue? If so, you can access the global from anywhere and there is no need for setting that variable at all - just set your find directly with the global value. Even if you really needed to set the variable, there is no need to use a GLOBAL variable $$ unless you want to display that 'find request value' on the Issue Report. It is best to use local variables as much as possible since they disintegrate naturally when the script ends. An additional suggestion, it appears you have FMP Advanced so you can turn on debugger and watch the script progress. The problem should pop up at you. :-)
Recommended Posts
This topic is 3322 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