Updating Fields based on each other value

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Updating Fields based on each other value

Post by weblike »

Imagine real world of invoicing. When you want to generate an invoice to a customer you have 2 possibilities with DueDate: or you write the Due days and the system calculates automatically the due date, or you enter the DueDate and the system calculates the due days.
So, in attached bsv we have a form where we select the Invoice Date suppose 02/21/2017, then we enter the duedays of 33, automatically the system puts DueDate=03/26/2017 (Correct)

If I enter 34 -> the system corrects and puts 33 and 03/26/207 (nothing works above 33 and 03/26/2017).

http://screencast-o-matic.com/watch/cbnrqN6DgM

Any ideas please?
Attachments
updating_fields_based_on_each_other.zip
Sample BSV
(35.34 KiB) Downloaded 513 times
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Updating Fields based on each other value

Post by PointsWell »

This isn't going to be helpful, but I can't replicate your problem.
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Updating Fields based on each other value

Post by weblike »

PointsWell wrote:This isn't going to be helpful, but I can't replicate your problem.
Have you tested with my bsv and followed the video?

1. Create new Invoice with Date: 02/21/2017
2. Enter Due Days = 33 --> as result the system will put DueDate = 03/26/2017
3. If you enter DueDays =34 --> the system will put DueDays=33 and DueDate=03/26/2017 (WRONG)

I use build 2238.

Thank you for your reply and testing this.
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Updating Fields based on each other value

Post by PointsWell »

I used your BSV and did the same steps that the video shows - the only thing different is that I am on Build 2237 on a Mac
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Updating Fields based on each other value

Post by weblike »

I have tested further and noticed that the Rules have problems with February and March.

I thought is because February has 28 days, but what the x!@#%^$ with March? With the other 10 months the rules are functioning ok.

I use DAY_DIFFERENCE function in the rules. Is something there?

Thx,
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Updating Fields based on each other value

Post by weblike »

UPDATE!!!
It's not functioning with January also!!!

Just tested the DAY_DIFFERENCE function:
1. If you summarize the date 01/01/2017 + 100 =>you'll get 04/11/2017
Selection_059.png
Selection_059.png (14.72 KiB) Viewed 22462 times
2. IF you do DAY_DIFFERENCE(01/01/2017, 04/11/2017) => you'll get 99
Selection_058.png
Selection_058.png (9.12 KiB) Viewed 22462 times
Selection_057.png
Selection_057.png (98.81 KiB) Viewed 22462 times
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
rob_h7
Posts: 85
Joined: Mon Jan 25, 2010 3:52 am

Re: Updating Fields based on each other value

Post by rob_h7 »

You should use DATE_ADD when adding days to a Date type field, rather than a Date+33

IF (Invoices.InvoiceDate WAS CHANGED OR Invoices.DaysDue WAS CHANGED)
THEN
Invoices.DateDue=DATE_ADD(Invoices.InvoiceDate,Invoice.DaysDue)
Rob . Aware 8.4 (build 2718), Developer Edition, using Linux, MYSQL
rob_h7
Posts: 85
Joined: Mon Jan 25, 2010 3:52 am

Re: Updating Fields based on each other value

Post by rob_h7 »

The attached bsv works
Attachments
DateFix.zip
(35.23 KiB) Downloaded 539 times
Rob . Aware 8.4 (build 2718), Developer Edition, using Linux, MYSQL
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Updating Fields based on each other value

Post by weblike »

Unfortunatelly doesn't work:

http://screencast-o-matic.com/watch/cbnZ196qvi

thx for testing this.
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
rob_h7
Posts: 85
Joined: Mon Jan 25, 2010 3:52 am

Re: Updating Fields based on each other value

Post by rob_h7 »

Rob . Aware 8.4 (build 2718), Developer Edition, using Linux, MYSQL
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Updating Fields based on each other value

Post by weblike »

WTF ?

Same bsv is behaving differently on 2 systems, that's makes me to think that something is different between builds.

I'm using build 2238, Windows 2012, MySql 5.6
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
rob_h7
Posts: 85
Joined: Mon Jan 25, 2010 3:52 am

Re: Updating Fields based on each other value

Post by rob_h7 »

Same build - linux - mysql 5.5.50

Browser?
Rob . Aware 8.4 (build 2718), Developer Edition, using Linux, MYSQL
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Updating Fields based on each other value

Post by weblike »

rob_h7 wrote:Same build - linux - mysql 5.5.50

Browser?
I've tested in Chrome and Firefox .....same thing...
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: Updating Fields based on each other value

Post by weblike »

I have installed new VPS with windows 10, AwareIM trial version, default DB => the result is same thing.


https://screencast-o-matic.com/watch/cbnZQF6qyu

:( :( :(

No more ideas!!!!!!!!!!!!!!!!!!!!!!!!!!! :(
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
Post Reply