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

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

Recommended Posts

Posted

This script goes through a found set of records and marks a field: 0

It works perfectly until there are more than 9 or so records. Then it skips maybe 2 of them. Then I have to run the script again to clean up the remaining records (it then successfully marks the ones it missed). It runs mostly through IWP if that makes any difference?

Thoughts appreciated!

uncluster.png

Posted

You'll need to post your script first.

It should be in the screenshot on the first post. Here it is as text:


Go to Record/Request/Page [First]

Loop

Set Field [inspection::inspectionClustered; 0]

Go to Record/Request/Page [Next; Exit after last]

End Loop

Perform Script ["GoToCluster"]

Posted

Is the found set sorted, and if so, does the field you set appear in the sort order?

Posted

Is the found set sorted, and if so, does the field you set appear in the sort order?

That's a red herring; a found set will NOT auto-sort while a script is running.

Posted

No herrings involved; just plain ignorance :logik:

That's a red herring; a found set will NOT auto-sort while a script is running.

Posted

Record lock issue? You have no check on that at all.

This might be an issue. I'll run the script a bunch on the client with 10+ records and see if I get a record lock notification.

Posted

Are there script triggers anywhere can might be bouncing things around?

Also you should be committing the record before going to the next.

Posted

Why? Going to next record will commit the current record, if open.

And if the record has validation?

Posted

Unless you are suggesting to commit while skipping validation, there's still no difference. In any case, failing validation should break the flow - not skip a record or two.

Like Barbara, I would suggest fitting the script with some error-capture/logging procedure.

Posted

For Example:

Go to Record/Request/Page [First]

Loop

Set Field [inspection::inspectionClustered; 0]

If (get (lasterror)≠0

// write this ID to a log

// exit script?

EndIf

Go to Record/Request/Page [Next; Exit after last]

End Loop

Perform Script ["GoToCluster"]

However, I would suggest rewriting the entire operation to be transactional if you need all records touched or if any one fails, then all edits roll back. See Todd Geist's blog.

Posted

I think I would go for something like:

Loop

Set Field [ ... ]

Set Variable [ $log ; List ( $log ; SerialID & Char ( 9 ) & Get (LastError) ) ]

...

Then, after the mystery is solved, I would ask why records need to be marked in the first place.

Posted

The OP mentioned that this runs under IWP. Could the 10 record limit be hitting here?

Posted

I think I would go for something like:

Loop

Set Field [ ... ]

Set Variable [ $log ; List ( $log ; SerialID & Char ( 9 ) & Get (LastError) ) ]

...

Then, after the mystery is solved, I would ask why records need to be marked in the first place.

If they are marked, they are kept on a list of "to do" records. If they are unmarked, they are not on the "to do" list. The "to do" list is for reports that still need to be printed and mailed to customers, billed through quickbooks (integration coming up :x). It's also to separate related records from other related records that I don't want to print. IE, these are inspection reports for units which belong to sites. If there are 6 units at a particular site and I only want to print reports on the first 2, then the 2 are marked and the other 4 are unmarked until i print the reports. Then I run this script which unmarks the 2.

The OP mentioned that this runs under IWP. Could the 10 record limit be hitting here?

I believe IWP list record max is 25, however it uses the next record step which shouldn't care if only 25 records are displayed, right?

Posted

Marking records is always problematic, because of locking issues. If the marking is arbitrary (which is usually user-specific as well), then it's better to write out a list of the marked records - either into a field, or as records in a related table. If it's not arbitrary, then it's redundant, because the status can be determined from the other data.

In any case, I'd suggest you run the logging procedure first to determine the cause of failure.

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