Calc Object in Browse Form

Questions related to using nuBuilder Forte.

Calc Object in Browse Form

Postby Mopatops » Wed Oct 21, 2020 3:39 am

Hi All

First off, sorry if the answer to this is already in the forum, but I have had a good look and couldn't find my answer.
I've recently started to learn nuBuilder, and am slowly getting my head around it. It's a great program, and I'm surprised how quickly you can have a working database.

My problem. When I create a Fast Form, and add a CALC object to it, it gives the tick option to be on the browse form. It does it's calculation OK on the EDIT form, but the browse form just stays at zero. It also creates a field in the database, which was unexpected. Because it's calculated live, I thought it wouldn't have a field in the database?
This seems to be the value that it reads in the browse form (it changes if I manually edit the database), and doesn't preform the calculation like the EDIT form does.

I may be reading the CALC object totally wrong, and having a calculation on the browse form may be bad programming, but it is leaving me a bit confused.

Thanks for any help.

Steve
Mopatops
 
Posts: 3
Joined: Wed Oct 21, 2020 3:21 am

Re: Calc Object in Browse Form

Postby Mopatops » Wed Oct 21, 2020 3:58 am

I've just been playing around a little more and noticed the live calculation does populate the CALC database field when saved from the edit form, so I'm now guessing the calculation is preformed on the edit form only, and stored in the database for use on the browse form?
I had been adjusting the values away from the edit form (it's actually on a subform), and nothing was changing on the browse form, but if I enter the edit form and press save, the value then appears in the browse form. This means the browse form does no calculation of it's own?

If this is correct, I assume I should only let the values be changed in the form that does the calculation, and knowhere else?

Steve
Mopatops
 
Posts: 3
Joined: Wed Oct 21, 2020 3:21 am

Re: Calc Object in Browse Form

Postby Janusz » Wed Oct 21, 2020 7:15 am

Hi,
I think the calc object is not good to be used in browse form and me I newer tried to use it. If you need any calculation to be performed in the browse you can use any sql statement in the Form/Browse/Display field for example:
Code: Select all
REPLACE(REPLACE(rej_month_closed,1,'✔'),0,'')
or
DATE_FORMAT(rej_activity_month,'%Y-%m')
or
...

I would use it only on edit form - but even there I prefer display object to use if I need some calculated data - but of course it depend on the DB specificity.
If you like nuBuilder, please leave a review on SourceForge
Janusz
 
Posts: 399
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Calc Object in Browse Form

Postby admin » Wed Oct 21, 2020 9:23 am

Mopatops,

You are correct, any calculations are done on the Edit Form.

So unless your table has been updated from somewhere other than the Edit Form, you should be OK using a Calc Object in a Browse Form.


Steven
admin
Site Admin
 
Posts: 3402
Joined: Mon Jun 15, 2009 9:53 am

Re: Calc Object in Browse Form

Postby Mopatops » Wed Oct 21, 2020 3:06 pm

Thanks for the replies. A slight modification to my database so values cannot be adjusted away from the edit screen, and it's now working perfectly.

Thank you

Steve
Mopatops
 
Posts: 3
Joined: Wed Oct 21, 2020 3:21 am


Return to General