AnsweredAssumed Answered

Excess windows opened / hanging  / crashing to OS

Question asked by JonathanWexler on Apr 18, 2014
Latest reply on Apr 19, 2014 by philmodjunk


Excess windows opened / hanging  / crashing to OS


     Using FMP v10 (Windows)

     Developing a script, which seems to be opening  a whole bunch of windows, and either hanging with the hourglass, or crashing to the OS (Windows).  I start with the window label (In top left corner) being <filename> and while running the script it progresses to about <filename>-75.  I am following advice I have read, but it is not working out for me. Anything obviously wrong (or could be done differently)?  Thanks for your help

     The script is as follows (text in red is explanation I have added for this post):

     DaveP Open Items
     #Empty script paramater turns on all column switches not yet    and selects "sort first by customer"
     #But first, we must get YTPM and MTD shipments, using the BobR layout
     #YTPM is year-to-prior-month; shipments are exclusive of shipping charges
     Set Field [ LineItems::DaveP_Open1_asOfDate; Get ( CurrentDate ) ] asOfDate is global
     New Window [ ]
     Freeze Window
     Set Variable [ $mtdShipments; Value:0 ]
     Set Variable [ $ytpmShipments; Value:0 ]
     Go to Layout [ “BobR Invoices” (Invoices) ]
     #Filter for current year
     Enter Find Mode [ ]
     Set Field [ Invoices::BobR_RevenueDate; ">="&Date(1;1;Year(LineItems::DaveP_Open1_asOfDate)) ]
     Perform Find [ ]
     View As [ View as Form ]
     Go to Record/Request/Page [ First ]
     #Update MTD and YTPM
     If [ Month(Invoices::BobR_RevenueDate)<month(lineitems::davep_open1_asofdate)]
     Set Variable [ $ytpmShipments; Value:$ytpmShipments+Invoices::Job Total ]
     Set Variable [ $mtdShipments; Value:$mtdShipments+Invoices::Job Total ]
     End If
     Go to Record/Request/Page [ Next; Exit after last ]
     End Loop
     Enter Browse Mode this and the following worked before adding the piece above
     #Start working on report
     Go to Layout [ “DaveP Open Items” (LineItems) ]
     Perform Script [ “Filter Unshipped Line Items” ]
     #save totals for use in report
     Set Field [ LineItems::DaveP_Open1_otherStats; $ytpmShipments ]
     Set Field [ LineItems::DaveP_Open1_otherStats[2]; $mtdShipments ]
     If [ Get(ScriptParameter)="DueDate" ]
     Sort Records [ Specified Sort Order: LineItems_Invoices::Shipping Window End; ascending
     LineItems_Invoices::DaveP_Sales1_customer; ascending
     LineItems::Invoice Number; ascending ] [ Restore; No dialog ]
     Sort Records [ Specified Sort Order: LineItems_Invoices::DaveP_Sales1_customer; ascending
     LineItems::Invoice Number; ascending ] [ Restore; No dialog ]
     End If
     #Go to Preview mode for earlier versions which do not support summary reports in Browse mode.
     If [ GetAsNumber ( Substitute ( Get ( ApplicationVersion ); "."; "x" ) ) < 1000 ]
     Enter Preview Mode
     [ Pause ]
     Enter Browse Mode
     Go to Layout [ original layout ]
     End If