Jump to content

Specify find requests error


This topic is 3587 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I'll try to keep this short. I'm having problems with find requests through a script I created. The script switches to a layout that lists every purchase order created by an employee. If the order was submitted it will have a "Yes" in the PO Saved box. When the "Check for duplicate" button is pressed it takes the variables that I set (Serial#, ItemName, Yes) and puts it in the correct fields for a find. THE PROBLEM: When the script runs the find, even if there is a match it will say "no records match". When I perform a find manually it also doesn't work UNLESS I just enter the first word of the item. For example: find for block off plate = no records found.  find for block = shows record.

 

Some needed info:

  • Script starts out on layout ShopOrderForm (table:PurchaseOrders)
  • Script switches to ShopOrders (table:Transactions)
  • PurchaseOrders & Transactions are related
  • Specify Find mode request has PurchaseOrders:POSaved  Criteria:$$Yes AND PurchaseOrders:Serial#  Criteria: $$SerialNum AND Transactions:item Criteria:==$$ShopItem

 

If anyone could help it would be greatly appreciated! I can't seem to figure it out!

post-111563-0-95829200-1405948286_thumb.

Link to comment
Share on other sites

You're mixing a Set Field step with the “Restore” options of the Enter Find Mode[] and Perform Find[] steps, which probably doesn't play well. Why not use Set Field[] for all three fields (or conditions) and do without the Restore?

 

(While you're at it, better use local $vars to capture your values; those $$globals will live on unless you explicitly clear/delete them (or close the file), which in the long run can be quite wasteful.

 

btw, it's not clear to me why you are performing this script; depending on the eventual goal, there may be an easier method to achieve it. (And it's good programming practice to prevent the creation of duplicate records, rather then accept and go looking for them … ).

  • Like 1
Link to comment
Share on other sites

  • Newbies

This script is used for a button that employees must click to check for duplicate records before they submit a purchase order form. You're right about the global variables too, I just assumed since my script switched layouts it needed to have a global variable! I took your advice and got rid of the "restore" in find mode and just used set field. This worked great. Thank you for your help!

 

PS- if you can think of an easier method for this that would be awesome.

Link to comment
Share on other sites

This topic is 3587 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.