AnsweredAssumed Answered

Script won't continue after find in Instant Web Publishing IWP.

Question asked by swillette on Aug 15, 2013
Latest reply on Aug 19, 2013 by swillette

Title

Script won't continue after find in Instant Web Publishing IWP.

Post

     I have a script that puts the name of a field into a varible, goes to a layout, enters find mode, sets a field with the contents of the varible and then performs find. There is an if statement that if Get(FoundCount) = 0 then go to another layout. 

     The script works perfect in the FileMaker application, but not in Instant Web Publishing IWP. In a web browser, a dialog box pops up letting me know record not found, but then takes me back to the search layout. 

     I want it to go to another layout if the Get(FoundCount) = 0.

     Here is the script:

         
  •           #Searches Dealers/Distributors by name to get Dealer/Distributor ID.
  •      
  •           Set Variable [ $DealerOrderName; Value:Orders::CompanyName ]
  •      
  •           Go to Layout [ “Dealer Distributor” (DealerDistributor) ]
  •      
  •           Enter Find Mode [ ]
  •      
  •           Set Field [ DealerDistributor::CompanyName; $DealerOrderName ]
  •      
  •           Perform Find [ ]
  •      
  •           If [ Get(FoundCount) = 0 //No records found. ]
  •      
  •           Go to Layout [ “Orders Entry” (Orders) ]
  •      
  •           Else If [ Get(FoundCount) > 1 //There are duplicate dealers with this name ]
  •      
  •           Go to Layout [ “Dealer Pick Orders” (DealerDistributor) ]
  •      
  •           Else
  •      
  •           Set Variable [ $DealerID; Value:DealerDistributor::DealerDistributorIDpk ]
  •      
  •           Go to Layout [ “Orders Entry” (Orders) ]
  •      
  •           Set Field [ Orders::DealerDistributorIDfk; $DealerID ]
  •      
  •           End If

       

Outcomes