Jump to content
Server Maintenance This Week. ×

Performing a Find


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

Recommended Posts

Hi All.

 

I would be very grateful if someone could help me with the following please: -

 

I have 3 buttons on a layout in List View each with scripts attached and performing the following: -

 

Button 1) - Find

Enter Find Mode []

 

Button 2) - Perform Find

Perform Find []

 

Button 3) - Cancel Find

Perform Quick Find [Projects:: Consultant = Get(AccountName)]

Sort Records [Restore; No dialog]

 

 

On cancelling any find I perform, I want the form to list/show only those records where the field 'Consultant' equals the account name the user has logged on with.

I get the message "No records find this match criteria"

 

I have tried creating a global field and crating a calculation Get(AccountName) and trying the following script also but still it doesn't work: -

 

Button 3) - Cancel Find

Perform Quick Find [Projects::Consultant = Consultants Directory::Global Account Name_c]

Sort Records [Restore; No dialog]

 

I hope I have explained this clearly

 

Cheers

Steve

 

Link to comment
Share on other sites

You don't specify a field for the Perform Quick Find command, only the search term (or an expression that evaluates to a search term).

 

To have a field included in a Quick Find, you need to “Include [it] for Quick Find” in the Data tab of the Inspector.

 

So, include Projects::Consultant for Quick Find (and maybe exclude the other fields on the layout from it) and use:

Perform Quick Find [ Get ( AccountName ) ]
Link to comment
Share on other sites

Or maybe use Perform Find[] instead of Perform Quick Find []. If you have any other fields enabled for Quick Find on the layout, performing a "regular" find will be both quicker and more reliable.

 

Note also that Quick Find searches only fields that are on the current layout and are enabled for quick find. If the field is not on the layout (or if you remove it at any point later) you will get the aforementioned error message.

Link to comment
Share on other sites

I tried the Perform Find[] and that method doesn't seem to work. 

 

Well, it depends on how you tried it. How about this way:

Enter Find Mode []
Set Field [ Projects::Consultant ; Get (AccountName) ]
Perform Find []
Sort Records [ Restore ; No dialog ]

Or, if you prefer:

Set Variable [ $acct ; Get (AccountName) ]
Perform Find [ Specified Find Requests: Find Records; Criteria: Projects::Consultant: “$acct” ][ Restore ]
Sort Records [ Restore ; No dialog ]
Link to comment
Share on other sites

Haha, brilliant!!!! that works also.

 

Could I ask for your help for one last thing please.

 

I applied your 1st lot of script to the 'On Layout Enter' of my Layout so that it finds the relevant records depending on what account name you log on with.

If no records exist or have been created however I get the error 'No records match this find criteria and the option Buttons 'Modify Find', 'Continue', 'Cancel'.

 

Selecting 'Continue' shows no records on the layout which is what I would like it to do as obviously no records exists at this point.  Selecting 'Cancel' shows all the records that may not be associated with that account.

 

How do I get it to just show no records without the message box / option buttons?

 

Steve

Link to comment
Share on other sites

Hi Comment

 

Thank-you for pointing me in the right direction, have been having a play around with it and this seems to work great: -

 

Set Error capture [On]
Enter Find Mode [] 
Set Field [Projects::Consultant ; Get (AccountName)] 
Perform Find [] 
Sort Records [ Restore ; No dialog ]
If [Get(FoundCount) = 0]
Show Custom Dialog ["No Records Have Yet Been Created"] 
End If





Thanks again

 

Steve

 

Link to comment
Share on other sites

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