Jump to content

Calculated Field Server Script Issue


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

Recommended Posts

Hi

I have a calculated field that successfully returns a value when accessed via a script run on the client, however when the same script is run as a FM Server(8) script, it is not returning values.

The calculated field is unstored and performs an aggregate function based on a TO relationship (simply, count the number of siblings of this parent).

Again, when I run this on the client it works, but as soon as it runs on the server the calculated field returns nothing.

FYI the script is running in one database and is accessing the parent table and sibling in another database. There are custom functions installed but these are not being referenced in the calculated field.

Am I missing something, like calculated fields don't work when accessed via server scripts, or not in server scripts when they access tables outside of their database?

Any help would be greatly appreciated.

Many thanks.

Link to comment
Share on other sites

"Siblings of a parent" Hmm. That's a bit odd. Parents have children, but siblings?

Could you provide us with actual field names and tables?

Are there any global fields involved that aren't being set when the server runs this script?

Link to comment
Share on other sites

Siblings! What was I thinking? I meant to say children.

I would upload the original files but they are very large (this db has been in operation for years). So I tried to replicate the problem by setting up a small example db and guess what ... this work fine, the script runs fine on the client AND the server!

The only immediate difference I can see is that everything is contain in this one example db file, whereas the real environment is 3 separate db files.

I have attached this example db, but of course it works! However if you can see any likely cause for the problem I would appreciate your comments.

(If you are wondering why all of this is being done it is because we have 6000 customers and 30000 jobs, and having unstored calculations to aggregate data is causing performance issues. We are happy to live with a daily snapshot of this summary data).

Thanks for taking the time to help.

Regards

Tim

example.fp7.zip

Link to comment
Share on other sites

I am pleased to say this has been resolved.

There was nothing wrong with the field definitions nor TO relationships. The issue was file references. For whatever reason, whilst file references using fmnet work from the client, they were not working from the server.

Making these relative fixed the issue for the server script and has had no detrimental effect for the clients.

Tim

Link to comment
Share on other sites

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