AnsweredAssumed Answered

Isolating a Find issue

Question asked by rtolliver on Mar 21, 2016
Latest reply on Mar 21, 2016 by Abingdon

I have a Find script that uses the previous year as part of the find criteria and for reasons I can't identify why the Year field is being changed.

 

The Script (B) Steps:

    go to layout ["FindLayout"]

    Enter Find Mode []

    Set Field [TO1::Year ; Year(Get (CurrentDate) ) ) -1]

    Perform Find [Restore]    //Criteria - TO1:: WoodType; [Red Oak]

 

The script is to return all records for Red Oak for the year 2015, but records from the year 2010 are included in the found set .


I have used Script Debugger and Data Viewer to try and isolate the problem.

In Data Viewer I monitor TO1::Year and TO1::WoodType, as I step through the script. The Year field contains the correct value until Perform Find is executed.  Once the Perform Find step is executed the WoodType field contains Red Oak but Year field changes from 2015 to 2010.

 

I've already got this script to work by removing the criteria in Perform Find and making it a Set Field script step. I still don't understand why the script didn't work.

 

This script(B) is a copy of an existing script(A) except for criteria (WoodType;Popular) is identical and works fine. Where I'm looking for help is in understanding why Script(A) works and Script(B) doesn't.

 

Thanks

Outcomes