Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi,

I would like to create a script that would perform a find whose criteria would be was is currently in a given field on the current record. Is this possible?

Thanks.

Posted

Something like;

Freeze Window

Set Variable [ $Find; YourFindField ]

Enter Find Mode [ ]

Set Field [ YourFindField; $Find ]

Perform Find [ ]

HTH

Lee

Posted

BTW you dont really need a script for this. You can just select the field that you want, right click and then choose 'Find MAtching Records'

Posted

It keeps telling me that ''No records match this set of find requests'' but this can't be true because if I go to find mode myself and type in a value, it finds the corresponding records. Any ideas?

Thanks.

Posted

Here it is. The reason I can't simply right-click and select "Find matching records" is because I want the search to be performed on another layout.

Freeze Window

Set Variable [$Find; Value:equipment_list::el_equip_name]

Go to Layout ["Inspection Issues" (inspection_issues)]

Enter Find Mode []

Set Field [equipment_list::el_equip_name; "$Find"]

Perform Find []

Thanks.

Posted (edited)

Maybe it's my tired eyes, but I don't see an error.

Why not use Script Debuger step through your script to see what is isn't doing.

Lee

[color:red]p.s.

You can also post a copy of your file here if you want

Before you do, remove any confidential information, or post a no record clone.

Edited by Guest
p.s.
Posted

Are you sure about this:

Freeze Window

Set Variable [$Find; Value:equipment_list::el_equip_name]

Go to Layout ["Inspection Issues" (inspection_issues)]

Enter Find Mode []

Set Field [[color:red]equipment_list::el_equip_name; "$Find"]

Perform Find []

Posted

You've switched to a new layout and new context, but the field that you reference is in the old context.

Posted

Also...

Set Field [equipment_list::el_equip_name; [color:red]"$Find"]

Get rid of the quotes.

Posted

What Barbara was trying to point out was that your script goes to a layout based on inspection_issues but you are searching for a value in the equipment_list table. Unless they are somehow related, you will not return the results that you want.

Posted

Nice catch John, I knew there was something that my eyes were not seeing.

Hey [color:red]TDavidson, when you use a variable, it is like using a field, and you don't need to enclose it in quotes, i.e. just $Find, not "$Find".

I think that your File Structure needs to be explained. If the two layout are two different Files, or TOs, you need to have a relationship in order for the script return anything. If on the other hand, they are both layouts in one TO, then you don't even have to change layouts, because the Set Field Script Step doesn't require the Field to be on the current layout, and you could then move the Go To Layout to after the Find has been performed.

HTH

Lee

Posted

I got rid of the quotes and it now works fine. There is a relationship between both table occurences so that shouldn't be a problem.

Thank you so much for your help guys!

This topic is 5616 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.