Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Determine Found Count within find script??

Featured Replies

I'm trying to create a script which allows the user to perform a find... and based on the number of records found I would like to change the layout. If the found set is 1 ... I display the detail layout and if the found set is greater than 1 ... I display a list so they can select which detail record they want to look at.

But it seems the "Get(FoundCount)" is not available until the script that is running has completed.

Thanks for your help

Glenn

It works for me:

Perform Find[]

If [ Get(FoundCount) = 1 ]

Go to Layout [ Detail ]

Else

Go to Layout [ List ]

End If

  • Author

Tried this before .... And one more time ... this is not working for me

Thanks

Glenn

Are you sure the Find has performed?

Can you post a screenshot of the script?

Try:

Enter Find Mode[]

Pause Script[]

Perform Find[]

If [ Get(FoundCount) = 1 ]

Go to Layout [ "Test Find" (Customers) ]

Else

Go to Layout [ "CustSearchList" (Customers) ]

End If

  • Author

Thanks .... I'll give this a try first thing tomorrow AM... I have a 13yr old birthday party to attend.

thanks

glenn

  • Author

Thanks .... It works

Not sure why ... but it works

Thanks again

Glenn

glenneg, because you went into find mode but you didn't tell it to perform the find. Once you enter it, you are just in the command to let you put in the criteria that you want to find. So, I usually do:

set error capture [on] //this is used so you can use the error to display the messages

go to layout (and pick the layout you want the user to use)

enter find mode [pause]

Now up to here you are ready to perform the find

perform find[]

if[get(LastError=400)]

show custom dialog["blah blah box"; "you didn't enter any

criteria..blah blah..."]

show all records

else

If[Get(foundcount)=0]

show custome dialog["blah blah box"; "No records match your request"]

show all records

go to layout[main]

else

If[Get(foundcount)=1]

go to layout[onerecordview]

else

go to layout

end if

end if

end if

Now with any of the "If(get(foundcount)= " you can do any command you want even perform another script. I like to play around with them. You can do some pretty cool things. Another, if you perform a find, then go back into script maker and copy that script, in the perform find command, you can click on "specify find request" and it will show your last find. That way you don't need to put a pause area in it and just make a button for the user if that is a scearch they always use...

Good luck and keep trying.

  • Author

Thanks for the tips and explaination.... it sure helps

have a great weekend

glenn

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.