I'm pretty sure I've had it work; but today it does not.
You'll need to describe what you are trying to do in more detail. Posting your script would be a good start.
Set Variable [$Variable ; value: Table::Field ]Enter find Mode [ pause:off ]
Set field [ Table::field ; $variable ]
Set Error Capture [on]
Perform FInd [ ]
Is a common way to use a variable with scripted finds.
To answer with equivalent detail:
What you suggested works if I add one more step after PerformFind. The find leaves me at one record previous to the target. (What I'm FINDing will always be the last record at that moment.) If I add Go To Record/Request/Page [Next] I end up where I need to be. Hardly a normalized procedure. (Am I using that term correctly?)
This is what I originally had that left me in the same position. (I didn't have Error Capture [On] so the script would just stop.)
Here is the first relevant part of the old script.
I used ExitScript when troubleshooting so I know I'm at the relevant context/record when the SetVariable is executed.
Here is the second relevant part of the script again with context verified.
This is what results:
With Error Capture [On}, I am left in the record immediately preceding where I need to be, the record with the value represented by $$P1ID..
Please do NOT use the RESTORE option when building FIND scripts.
Write the script as Phil instructed.
Your screen shot shows that the problem is that the script is putting "=$$P1ID" in the field, instead of "=" followed by the value of $$P1ID.
The only way I can think of for this to be possible is that $$P1ID does not exist. If you have Advanced, check the data viewer. If not, pop a custom dialog to present the value of $$P1ID to confirm it has a value.
Some possibilities - your Set Variable script step is in a conditional that isn't running as you expect, or the field reference for the value is not valid.
Hardly a normalized procedure. (Am I using that term correctly?)
And your script is simply not finding records. If it's off by one from the record that you want, that is purely chance.
And this doesn't look like a case where you need to perform a find. Since this is an ID, you could set up a relationship to match to the correct record.
This got me to scrutinize the script again--this time after a good night's sleep..
I found Phil's step to work, after I double-checked what I was putting in the find step. Turned out I had put in $P1ID rather than the correct $$P1ID.
Retrieving data ...