August 22, 20169 yr I have a Payments List View layout that can be opened from any layout using: New Window . . . Go to Layout . . . Except this one other List View layout. It just ends up as a new window of the same layout. New Window . . . Go to Layout . . . will not open any other layout. Driving me nuts. What causes this? FM15 Advanced
August 23, 20169 yr Author This is the new window script that works on all layouts except the Orders List layout: Sales Orders Scripts: Sales Orders Payments: PP - Goto Payments Layout New Window [ Style: Document; Name: "Paypal Payments IPN"; Top: 0; Left: 300; Close: Yes; Minimize: Yes; Maximize: Yes; Zoom Control Area: Yes; Resize: Yes ] Go to Layout [ “Paypal Payments” (paypal_ipn_orders) ] This script trigger runs on layout enter: Sales Orders Scripts: Sales Orders Payments: PP - Open List - Adjust Window Resize to Fit Show ... Allow User Abort [ On ] Show All Records Enter Find Mode [ ] Insert Calculated Result [ paypal_ipn_orders::creation_timestamp; " > " & Get ( CurrentDate ) - 7 ] [ Select ] Perform Find [ ] Sort Records [ Keep records in sorted order; Specified Sort Order: Payments Status::MAP Status; descending paypal_ipn_orders::id; descending ] [ Restore; No dialog ] Scroll Window [ Home ] Adjust Window [ Resize to Fit ] Move/Resize Window [ Current Window; Height: 1100 ] Show/Hide Toolbars [ Hide ] Halt Script The Orders List layout also has a script trigger on layout enter: Online Orders Scripts: OO - Open List - Adjust Window Resize to Fit Show All Records Sort Copy Enter Find Mode [ ]Insert Calculated Result [ rtd_orders::insert_date; " > " & Get ( CurrentDate ) - 6 ] [ Select ] Perform Find [ ] Sort Records [ Keep records in sorted order; Specified Sort Order: rtd_orders::order_id; descending ] [ Restore; No dialog ] Adjust Window [ Resize to Fit ] Move/Resize Window [ Current Window; Height: 1100 ] Show/Hide Toolbars [ Hide ] Scroll Window [ Home ] Halt Script
August 23, 20169 yr Hi cos, Have you performed this find manually? Have you ran the script using Script Debugger and Data Viewer? The Show All Records is an unnecessary step, a Find looks at all records. Use Set Field script step, instead of Insert Calculated Result. The Insert Step requires the field to be on the current layout. I would disable all of the unnecessary steps (i.e. window sizing, user abort, etc.) until the script performs as desired. Lee
August 23, 20169 yr Author I have run the Script Debugger multiple times comparing successful page and unsuccessful. It fails at line 2 of the first script. It opens the wrong layout. I can't get past that. But, I did not use the Data Viewer (doh). It is returning unusual data at line 2 which the other layouts are not. Name: rtd_orders::insert_date Value: 8/18/2016 Type: Date That's an old date. Making your suggested changes (which i did, thanks) doesn't matter because it never gets to that script because the first script opens the wrong layout.
August 23, 20169 yr Sales Orders Scripts: Sales Orders Payments: PP - Goto Payments Layout New Window [ Style: Document; Name: "Paypal Payments IPN"; Top: 0; Left: 300; Close: Yes; Minimize: Yes; Maximize: Yes; Zoom Control Area: Yes; Resize: Yes ] set variable $e1 = get last error Go to Layout [ “Paypal Payments” (paypal_ipn_orders) ] set variable $e2 = get last error Exit Script Step thru this one line at a time. What are the contents of $e1 and $e2?
August 23, 20169 yr When you make a new window, the current layout is reloaded and the OnLayoutEnter script trigger fires. The Orders List layout's triggered script ends in Halt Script[]. The Halt Script[] script step ends all running scripts, such as the new window script, so you never get to the Go to Layout[]. Use Exit Script[] in place of Halt Script[] in the Order List OnLayoutEnter triggered script.
August 23, 20169 yr Author Thanks to all. David's solution is correct. Man, how easy it is to miss the small things.
Create an account or sign in to comment