July 19, 20178 yr Hi, I have a global variable that has been set from previous a script. This global variable is $$abc and has a value of 100. I have two fields on Table A, Field1 and Field2. Field 1 has a value of abc, and field 2 is a calculation field with this formula: (Evaluate ( "$$" & Field1 ) ). The calculated result, in this case, should be "100" since that is the value of the Global Variable that I have set on the previous Script. However, I don't know what I am doing wrong. I Evaluate the formula on data viewer and it evaluates it correctly, but on the calculation field, it is just not working. I have tried to set the formula as $$abc directly, and still, it does not perform the calculation on the field. Any ideas would be much appreciated. Thanks a lot in advance for your time. Hi, I just solved the problem, it seems that calculation needs to be set to not store calculation results. Thanks a lot for just reading this!
July 20, 20178 yr Reconsider having a calc field that is based on a global variables. Or any kind of variable. It would recalculate for all visible records in the found set so: why?
July 21, 20178 yr Author Wim, Many thanks for your comment. I am still a newbie, and this solution is meant for a small family business that rent out apartments for holidays. My solution is a booking engine. There is a check in date and check out date and when you write those, a portal shows which apartments are available, but it didn't show the price for those dates. What my script does is to disintegrate the date ranges into each day as a record on another table. Then each day is loop into the season tariffs table to check whether it falls into the date range of a specific tariff (each season is a record) when it finds it, it gets the price per day. Then I get a field to summarize all prices per day for that booking, and that is the price that it is passed through as a global variable to another table just before I completely delete all individual days records so I can make a new inquiry afterward. Then on the apartments Table, I do the calculation to show the $$totalbookingcost and show if the apartment is ready for those dates. If my explanation of the process was clear enough, would you suggest a simpler approach to not use the calc field to be based on a global variable? I know this process may seem complicated but I couldn't come up with any other solution Right now the solution is working perfectly, but I am craving to learn more and more Filemaker approaches since I am so passionate about learning new programming skills! Thanks a lot in advance,
July 21, 20178 yr 5 hours ago, docasar said: Then I get a field to summarize all prices per day for that booking, and that is the price that it is passed through as a global variable to another table just before I completely delete all individual days records so I can make a new inquiry afterward This piece does not sound right. I would probably want to keep all the inquiries and set the price statically through a script instead of relying on calculated fields. Any calculations can be done in the script and the result stored.
Create an account or sign in to comment