I have a MySql Formula field and it stopped working after upgrade to 2.8.
It does not change the value when the values of [975] or [563] change. It used to work fine.
I changed the "IF" from capital to lower case and it did not make a difference. I reversed the order of the fields in the formula and that did not make a difference.
MySQL Formula not running
-
- Posts: 51
- Joined: 12 Sep 2020, 19:39
- Name: Steve
- Location: US Los Angeles
- support
- Site Admin
- Posts: 6222
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: MySQL Formula not running
Fields [975] and [563] are entered?
-
- Posts: 51
- Joined: 12 Sep 2020, 19:39
- Name: Steve
- Location: US Los Angeles
Re: MySQL Formula not running
Yes, there are values in those fields. One of the fields is current quantity of supplies and the other field is minimum required quantity. If current supply drops below minimum, then system alerts user to order more supplies. It was working in version 2.7.
The last column should change when quantity and minimum quantity columns change. The last column does not change. Notice that one item has lower quantity than required minimum and other item has higher quantity, however the last column shows "0" for either scenario.
The last column should change when quantity and minimum quantity columns change. The last column does not change. Notice that one item has lower quantity than required minimum and other item has higher quantity, however the last column shows "0" for either scenario.
- support
- Site Admin
- Posts: 6222
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: MySQL Formula not running
Fields [975] and [563] are simple numeric fields?
Try to change formula to
if(([975]+0)>([563]+0),1,0)
Try to change formula to
if(([975]+0)>([563]+0),1,0)
-
- Posts: 51
- Joined: 12 Sep 2020, 19:39
- Name: Steve
- Location: US Los Angeles
Re: MySQL Formula not running
Interesting..... that fixed it. It works now. I do not understand why adding 0 helps.
- support
- Site Admin
- Posts: 6222
- Joined: 19 Oct 2014, 18:22
- Name: Sergey Kharchishin
- Location: Russia, Evpatoriya
Re: MySQL Formula not running
It's because numeric fields stored as varchar in database. I had target to allows enter empty value in number.
So if you compare two fields you compare strings. But if you add 0 then mysql compare numbers.
So if you compare two fields you compare strings. But if you add 0 then mysql compare numbers.
-
- Posts: 51
- Joined: 12 Sep 2020, 19:39
- Name: Steve
- Location: US Los Angeles
Re: MySQL Formula not running
Thank you!