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

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

Recommended Posts

Posted

Hello,

I have created an inventory control database. It seems to work fine most of the time, but occasionally, I get some funny results from my scripts. For instance, In the Purchase Orders database, a script takes the Qty and uses a SET FIELD in my master database to adjust the ON ORDER Qty. Occasionally there are numbers coming out that did not go in. My script is a very simple operation, mostly a SET FIELD and a FIND based on a Global Field. How can this happen to me? The script is only addition or subtraction.

Thanks,

Posted

Another user here on FMForums has often said, "What you know ain't so." I have made it my mantra when something goes wrong.

I recommend going through your scripts line by line. Although this seems like a little more work, make a layout in each of the files that are called by your script and include all fields involved. Pepper your scripts with pauses and examine the results at each stage. This will help you pinpoint where things are going wrong.

Posted

You mentioned that your find is based on a global field. If you db is multi-user remember that global fields can be set to a different value for each user, which might be why you get different results.

Posted

I've found the FM sometimes has problems with floating point math, but it sounds like you an't doing that anyway.

I've had FM tell me that 0.07 + 0.075 = 8450

Your could be somthing like that.

Aswell, make sure all your layouts don't allow entry into fields that shouldn't

Posted

I have been playing with my scripts using pauses and such. I can't see any particular problem. The real problem I have is that this only occurs in certain records. If it happened in all records then I would think that the script was at fault. But this problem picks certain records, and consistantly enters bad numbers, while other records have no problems. I have tried deleting the record and making a new one that is exectly the same, but it does not change the problem.

Posted

It sounds like a data-type mis-match problem -- text fields holding numbers that are then used in mat calculations.

Is the ON ORDER field a number or text field? How about the global field?

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