AnsweredAssumed Answered

Use Script or Calculation fields in Database - complicated computation

Question asked by BillPlunkett on Dec 6, 2013
Latest reply on Dec 6, 2013 by philmodjunk


Use Script or Calculation fields in Database - complicated computation


     I'm trying to develop an application in FM13 after being away from FM for awhile and writing in a "conventional" language.  So here's something I have to do that was easy in C.  I need to calculate the cost of building a fence (ranch kind, not backyard) and it can have 2 different types of wire (say barbed wire plus a couple of strands of electric wire).  It can/will have corner posts, standard posts and then extra support posts (I call them Interval Posts).  The standard and interval posts each have a spacing factor.  Say the "T-posts" are spaced every 8 feet but there is a heavier support post every 50 feet.  I have to calculate the number of standard post needed by dividing the total perimeter footage by the spacing factor but the subtract the number of interval posts that are calculated in the same fashion.  Plus other factors but this will get to my point.

     Before I can calculate the number of standard posts needed I have to calculate the number of interval posts.  If these calculations are in the database as calculation fields how do I know the sequence they will be performed?

     Would it make more sense to have the user input all the relative data and then click a "calculate" button that performs a script and then plugs the calculated values into the DB record?  This would allow me, with the use of local variables, to break the steps down to where everything is fairly simple and is the way I think I want to do it.  But I sure would like to hear from some FM experts before I commit one way or the other.

     thanks, bill