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

How to preview the current record


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

Recommended Posts

Posted

Is there a simple command in FM to preview the current record; rather than previewing the entire found set until one gets to the required record?.

Thanks

Posted

One way to do it might be to make a script that finds the current record and then goes into preview mode.

Something like:

Set variable $currentrecord

Perform Find $currentrecord

Enter Preview Mode

Posted

You may wish to isolate the record in a new window. This way, you can close the window after preview and maintain the user's found set.

Posted

No need to perform a find.

New Window

Show All Records

Omit Record

Show Omitted

Posted

Thanks,

The second line of the script is to Perform Find, is asking for a field to choose. Please help.

Posted

Both the Set Variable and Perform Find should ask for a field. They just have to be the same. If you're using the record ID (serial number) then you can set a variable like $serialID and then tell it to use the serialID field. Then when you do a find you would use look for the same field serialID that would equal $serialID (the variable you set earlier).

Does that make sense?

Vaughan's way might be better though.

Posted

Isn't omitting a record and then showing the omitted the same as doing a find?

Posted

Isn't omitting a record and then showing the omitted the same as doing a find?

No. Performing a find is more work for the CPU and can be significantly slower with large record sets.

See also:

http://fmforums.com/forum/showtopic.php?tid/184454/post/239925/#239925

Posted

Great to know! I'll change my evil ways.

So is this what should be used? (taken from the thread link)

Loop

Exit Loop If [ Get ( FoundCount ) = 1

Show All Records

Omit Record

Show Omitted Only

End Loop

Posted

Get rid of the loop. What if the found set is empty? Either way it's redundant.

Posted

OK, yes, I see what you're defending against... but that could happen any time.

Posted

No need to perform a find.

New Window

Show All Records

Omit Record

Show Omitted

I can't believe how many times I could have used this script in the past. It might be simple, but with the addition of the final step, Enter Preview Mode, it's a great tip. Thanks.

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