Calculation against database data

Hi Julian,

Was thinking about the possibility to make calculations against/using data from the database in addition to those available in the actions button. So instead of making calculation using data displayed in lists/views we can use similar action button to calculate using data from the database. That would make formulize more flexible. What do you think?

Comments

You can have custom buttons execute some PHP

Hello,

There is an option to have a custom button execute some PHP, or even display HTML on screen, and I think you might be able to already use PHP to generate that HTML, which is probably exactly what you want. And if that's not already possible, it would be a very small step to get PHP to generate the HTML.

So that's a neat solution. I think if this is about your budget tracking needs, there may be a more robust solution though. I just don't know what it is, but suspect this is one, we'd need to talk it over.

Frankly, if you're involving PHP, then you can just make any arbitrary page and query the database and have a custom report that way. Formulize is good for managing the data input, and workflows. Highly, highly custom reports, that can sometimes lead to PHP and direct database queries.

Another trick you can do sometimes is use the list of entries screens, and specify some PHP code for the list template, just to add up some numbers, and put them in the global space, and then refer to those global variables in the bottom template and oputput them to the user there. So you effectively have no list in the normal sense, just a dashboard at the bottom of the screen, based on math you've done as you iterate over each record in the list (ie: keep a running total).

Maybe options...question is which is the right one for you. :-)

--Julian