October 4, 20241 yr Howdy all, I have a script that performs a Find using the OnRecordLoad script trigger. However, if a user manually uses the Show All Records command, the script trigger won't fire because there's no trigger; a record isn't loaded until the user clicks on a field. Is there a means of firing the script after such a circumstance? Cheers, Rich
October 4, 20241 yr 55 minutes ago, Rich S said: a record isn't loaded until the user clicks on a field. I don't think that's a correct statement. An OnRecordLoad script trigger will act when a new record is loaded. Calling Show All Records does NOT load a new record, unless you started with an empty found set. Clicking on a field is entirely irrelevant here. What is the purpose behind this? It sounds like you are actually trying to solve some other problem - something to do with record access privileges, possibly?
October 4, 20241 yr Author Better to illustrate than use verbose prose. : ) In the attached vid (same vid, one's .mov and the other .mp4), I enter Find mode and in the Order Number field, enter "Stuart." The found records appear...and notice under the Jobs List heading a value list--through a calculation, it looks at what Status values are used in the found set and "ticks the boxes." Next, I enter Command +J (Show all records.) The value list at the top doesn't automatically update with the appropriate ticked boxes, of which four out of the six should be ticked. When I click in the Order Number field, the ticked boxes appear as they should. As an aside, the two fields used to generate the "used" Status list are: Order Status (calc) ORDER_FORM_CHILD, = UniqueValues (OrderStatus__lxt) Order Status (summary) = List of OrderStatus (text) Screen Recording 2024-10-04 at 10.43.13 AM.mov Screen Recording 2024-10-04 at 10.43.13 AM.mp4 Edited October 4, 20241 yr by Rich S
October 4, 20241 yr 1 hour ago, Rich S said: Next, I enter Command +J (Show all records.) The value list at the top doesn't automatically update with the appropriate ticked boxes Does the attached file behave as you would expect? FoundValues.fmp12
October 4, 20241 yr Author Could work. Thanks! It'll take me a while to figure out how the $letter variable works.
October 4, 20241 yr 2 minutes ago, Rich S said: how the $letter variable works That's irrelevant to what the demo is designed to show. The point is that after showing all records the list of found values is automatically updated. Without any script trigger or any script at all.
October 4, 20241 yr Author Indeed, but it's important to me to learn how things work, so knowing the how's and why's of why this code does that makes me a better coder; gotta admire your wizardry. : D Edited October 4, 20241 yr by Rich S
Create an account or sign in to comment