Digitalbrit Posted July 1, 2009 Posted July 1, 2009 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.
bcooney Posted July 1, 2009 Posted July 1, 2009 "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?
mr_vodka Posted July 1, 2009 Posted July 1, 2009 Please post your script or better yet a copy of the file.
Digitalbrit Posted July 2, 2009 Author Posted July 2, 2009 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
Digitalbrit Posted July 4, 2009 Author Posted July 4, 2009 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
Recommended Posts
This topic is 5712 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 accountSign in
Already have an account? Sign in here.
Sign In Now