May 24, 200223 yr 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,
May 24, 200223 yr 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.
May 28, 200223 yr 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.
May 28, 200223 yr Author My db is a multi-user system, but this problem started before I linked up to another user.
May 28, 200223 yr 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
May 28, 200223 yr Author 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.
May 28, 200223 yr 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?
Create an account or sign in to comment