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

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

Recommended Posts

Posted

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

Posted

It works for me:

Perform Find[]

If [ Get(FoundCount) = 1 ]

Go to Layout [ Detail ]

Else

Go to Layout [ List ]

End If

Posted

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

Posted

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.

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