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

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

Recommended Posts

Posted

Here's my problem, hopefully someone out there has some insight.

I have 3 tables, one called Paginator, one called Gaps, and one called Ads. Each entry in ads has a measurement, and I'm trying to fit a number of those ads into a Gap, which has a larger measurement. Basically, the script I'm using looks at the space left in each Gap and finds the best Ad to fill that space.

So here's my problem. I'm trying to test the length of an ad against the space left in a gap, to see if the ad is a candidate for insertion. The problem is, that when I've already inserted two other ads, the length stops updating, to reflect the space filled by the ads it already holds. The calc goes like this

Length = Bottom - Top - Sum(AdsInThisGap::Inches)

where bottom - top returns the actual size of the hole to fill, and the sum adds up all the ads that are already placed in the gap. But like I said, I'll add the first ad, and the length function updates. When I add the second, it doesn't, and so the third ad thinks that the second didn't take up any space. Does that make sense?

The calculation is unstored, of course, and its being called inside of the Paginator table, by an if function over a relationship that I've verified is hooking to the right Gap.

Any ideas? Do sum functions not work over a relationship? The only thing I can see possibly being an issue is that the sum part of the function is basically being grandfathered into Paginator (paginator asks gaps for length, which asks ads for sum of inches). Can I not do that? How else can I get a sum grandfathered like that?

Posted

Refresh problems are hard enough to solve when you get to see the files. If you are running a script, I wouldn't think there should be refresh problem. If your script is at all dependent upon a layout for correct operation, you may have to refresh the layout. I would probably lose the calculation field and perform the calculation with a Set Field to update the length in the script.

-bd

Posted

Well, I tried just doing a set field instead of a calculation, but it was just so complex that I knew it would be ripe for bugginess later (there's a lot of alteration to that number!). So instead, I just set up a calculation parallel to the real calculation, in the database that the script is running in. This synced it up fine. Now, is there any good resources out there, for reading up on refresh and synchronisation and all this? Thanks so much for all your help! smile.gif I just figure I'll see if I can find a good body of knowledge to study, now, so this won't happen again.

  • Newbies
Posted

Try using the 'Go to Field' option in your script send it to the field you wish to recalculate, (the Length field you mention).

Usually on unstored calculations this forces it to recalculate.

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