Combine Calc-Field with Select-Field and Number-Field?

Questions related to using nuBuilder Forte.

Combine Calc-Field with Select-Field and Number-Field?

Unread postby Olikun » Sat Mar 13, 2021 5:00 am

Hello,

i have a new question.

I would like to combine a Calc field with a Select and Number field.


I declare:

We work with meat.
The meat must be marinated.

We have 2 types

Type "salt": with salt / without pepper

Type "pepper": without salt / with pepper


The Calc field should display the correct amount, depending on what was specified in the Select field.

The meat is entered in kg in the Number field


I have another picture

Image
Olikun
 
Posts: 48
Joined: Wed Mar 10, 2021 3:15 am
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby kev1n » Sat Mar 13, 2021 3:56 pm

Code: Select all
The Calc field should display the correct amount, depending on what was specified in the Select field.


I don't understand how it should be calculated. Please write down the conditions/caluclation logic.
kev1n
nuBuilder Team
 
Posts: 1625
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby Olikun » Sun Mar 14, 2021 4:23 pm

Janusz wrote:Hi Olikun,
I prepared short example/demo how to implement time recording with nuBuilder.
And some calculation example on the form - for the spices calculation :)
You can find video with explanation on youtube:
https://youtu.be/LJmKrOQ-AP8

This demo is available on our server:
https://test.nubuilder.cloud/

you can log with:
login: test
psw: nutest

This is in demo mode so you can have access to the used code - but if you implement some changes it will not be finally saved.

If you would have some questions please let me know.


Hello Janusz,

thank you so much, you are great

I have successfully recreated the Spice Tool.
The values ​​are calculated, but I cannot save it

I recreated the whole form in my test nubuilder and all field names are identical

Do you know what the problem is?
Olikun
 
Posts: 48
Joined: Wed Mar 10, 2021 3:15 am
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby kev1n » Sun Mar 14, 2021 5:06 pm

There can be various reasons why saving does not work.

- Check the nuDebug Results for errors
- Check the Developer Console (F12) for errors
- Check your (Apache) Server log

Did you also add the Custom Code and the 2 onchange events?

I attached to files that contain SQL statements to create the demo. Run them in phpMyAdmin to generate a table calculation and the nuBuilder objects.
Attachments
calculation.sql.txt
(2.87 KiB) Downloaded 12 times
nubuilder_spices.sql.txt
(15.1 KiB) Downloaded 10 times
kev1n
nuBuilder Team
 
Posts: 1625
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby Janusz » Sun Mar 14, 2021 6:13 pm

If you like nuBuilder, please leave a review on SourceForge
Janusz
nuBuilder Team
 
Posts: 463
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby Olikun » Mon Mar 15, 2021 2:23 am

Hello Janusz,

I have created the whole form again but it does not work with the save yet.


I have sent you the login details for my nuBuilder.

Can you please, if you have the time, see what the problem is?

that would be extremely great
Olikun
 
Posts: 48
Joined: Wed Mar 10, 2021 3:15 am
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby Janusz » Mon Mar 15, 2021 2:50 am

should be OK now
If you like nuBuilder, please leave a review on SourceForge
Janusz
nuBuilder Team
 
Posts: 463
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby Olikun » Sun Apr 04, 2021 1:21 am

I have a new question on this subject

The code works and I am using it, but I need new code elsewhere

I just want to take a field x 10 and output the result in a new field


Image
Olikun
 
Posts: 48
Joined: Wed Mar 10, 2021 3:15 am
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby kev1n » Sun Apr 04, 2021 1:28 am

Use a Calc object type for field 3 and add a calculation.
kev1n
nuBuilder Team
 
Posts: 1625
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Combine Calc-Field with Select-Field and Number-Field?

Unread postby Olikun » Sun Apr 04, 2021 1:35 am

:roll:
Oh yes right

I already know the Calc function

it was a stupid question :lol: :oops:
Olikun
 
Posts: 48
Joined: Wed Mar 10, 2021 3:15 am
nuBuilder Version: 4.5

Next

Return to General

Who is online

Users browsing this forum: GlenMcCabe and 31 guests