Jump to content

Problem With Find not seeing all records


sflynn

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

Recommended Posts

I am trying to do a simple find. I have a checkbox field the user selects to add a record to the print queue. I have a script running that goes to that layout, finds all records, enters find mode, sets the field to "print", and then finds. It works the first time I run it, but when I add more records to the print queue it doesn't see the records. So I went directly to my layout cuz I thought maybe it was a scripting thing, but I get the same behaviour going to find mode and doing it manually. It seems to work if I quit out of my file, relaunch and then it works the first time through... does this sound familiar to anyone?

Link to comment
Share on other sites

You say "when I add more records to the print queue it doesn't see the records" — you didn't specifically say so, but I assume you mean that you re-run the script and it doesn't find the newly added records that have have their checkboxes checked?

a) Why does your script find all records before entering find mode and performing the specific find you want? (That doesn't hurt anything, and it's not causing your problem, but it's a totally useless & irrelevant script step).

;) Check your script closely. Is the Perform Find script step done with no specification (checkbox at lower right is unchecked)? If not, that specification is going to override your Set Field script step which would otherwise specify what Find you're going to perform.

c) Is the value list associated with the checkbox field definitely, positively, "print" and not something else, on every layout where it is available to be checked? No chance it's formatted with the wrong value list somewhere?

d) Briefly switch the field (on the layout where the scripted Find does its thing) from checkbox format to Edit Box, and make it wide enough to see the full field name. Is it preceded by colons, e.g., ::FieldName ? If so, you've referenced it from the wrong table occurrence and that could be the culprit.

Edited by Guest
Link to comment
Share on other sites

Thanks for all that. I'll use those tips to clean my stuff up. I discovered something odd that fixes my problem. The user selects these print fields via a portal that is inside a tab. Turned out that when I'd check/uncheck the boxes and then click outside the tab the script worked fine. I tried (for fun) having the script select an object or field outside the tab but that didn't work. I had to use the mouse to click outside the tab area. For the moment my problem is solved as I've duplicated the layout where the script originates. In my script, I first have the script jump to that layout and back to the original (sort of refreshing the screen) and then the script works like a charm.... go figure that?

Link to comment
Share on other sites

I am very close to nominating the "Tabs on Layouts" feature as the worst feature-from-hell since Find & Replace made its debut.

No one needs them — they don't provide any service that I can see that you can't approximate with other tools — and man alive do they cause problems right & left!

Link to comment
Share on other sites

Your question doesn't make much sense and can't be effectively answered without seeing the entire script. It may also be that you need to add a "commit record" statement at the first part of your script. AHunter3: what have tabs go to do with anything being discussed here? They are effective tools for efficient use of layout space.

Link to comment
Share on other sites

AHunter3: what have tabs go to do with anything being discussed here?

In the post prior to mine, the OP wrote:

I discovered something odd that fixes my problem. The user selects these print fields via a portal that is inside a tab. Turned out that when I'd check/uncheck the boxes and then click outside the tab the script worked fine. I tried (for fun) having the script select an object or field outside the tab but that didn't work. I had to use the mouse to click outside the tab area.
Link to comment
Share on other sites

Ok, look at this script and tear it apart... I'm sure I have some redundancy in this script, tell me why this was behaving like I said.

* User starts script to find only selected records to print while in a portal on a tab:(The portal shows the print field from (Media Asset Main)

- New Window

- Go to Layout (Media Asset Main)

- Show All records

- Enter Find Mode

- Go to field (Media Asset Main::MA_LabelPrintQ)

- Set Field (MediaAsset Main::MA_LabelPrintQ;"Print")

- Perform Find []

- Enter Browse Mode []

- Go to Layout [Print Video Labels From Assets for Video"(MediaAsset Main)]

By the way, the field (MA_LabelPrintQ) is selected by a value list so I know they all have the value "Print"... or nothing.

Be gentle!

Is there a way to easily get a script into this forum?

Thanks for your guidance.

Link to comment
Share on other sites

It is not at all clear what your problem is. You perform a find. So what? What is WRONG?

Here's the script with the non-essential stuff removed.

- Go to Layout (Media Asset Main)

- Enter Find Mode

- Set Field (MediaAsset Main::MA_LabelPrintQ;"Print")

- Perform Find []

- Go to Layout [Print Video Labels From Assets for Video"(MediaAsset Main)]

Link to comment
Share on other sites

Well, for ONE thing, you're searching for local records that match a parameter that's in a portal record;

User starts script to find only selected records to print while in a portal on a tab:(The portal shows the print field from (Media Asset Main)

the portal goes to a table occurrence called "Media Access Main", which is not the LOCAL table occurrence associated with this layout, it's a RELATED table occurrence, is that correct? (If that's not correct, scratch the rest of this post as a communications misfire and ignore it).

So your LOCAL table occurrence, the one that's listed when you go to Layout Setup for the current layout, that's some OTHER table occurrence, not "Media Access Main"?

But the found set you end up with is a found set in the LOCAL table. You aren't searching for all the records in Media Access Main where MA_LabelPrintQ = "Pri nt" (even if that's what you think you're doing, even if that's what you intended to be doing); instead, you are searching for all the records in the LOCAL table that happen to have at least one related record in Media Access Main where MA_LabelPrintQ = "Pri nt".

With me so far?

So after your Find has taken place, you navigate to a different layout. The different layout is owned by Media Access Main, you say.

Well, so much for any connection whatsoever and whithersoever to your found set. Your found set is in the LOCAL table (the one that's local to the layout you started on). When you go to a layout owned by a different table occurrence, it's going to have whatever (totally irrelevant) found set happened to exist in that other table occurrence.

Aside from all that, you did ask about any redundancy in your script. You do have some.

• You don't need to do a Show All Records prior to doing a Find.

• You don't need to have a script step to Enter Browse Mode after doing a Find.

Finally, there's a script step you should add: if you're going to do a Find in a script, you should Set Error Capture On, so that instead of popping up an error message about no matching records followed by another error message asking if the script should be aborted or continued, you can simply test for whether Get(FoundCount) = 0 or not, and if it does you toss up an error message of your own wording and return the user to a nice safe bail-out layout (and do a Show All Records so the user isn't in zero-found-set land).

Edited by Guest
Link to comment
Share on other sites

Thanks for the input I'll take what I can from it. The strange thing is that by inserting a jump to another layout and back to the original and then running the script it works great! Its so simple it shouldn't be an issue. I will check and make sure I'm not jumping to the wrong table occurance.

Thanks again ya'll!

steve.

Link to comment
Share on other sites

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