problem with table calculations

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

problem with table calculations

Postby craig-c » Thu Feb 26, 2009 6:00 pm

Hi,

What's up with table calculations in Servoy??? I've just had all the calculations in one of my tables just disappear into thin air. This is the second time its happened with the same table. Each time it's happened, I've basically lost around 2000 lines of code (probably more than that).

All I've done is create a new form and then add a rowBGColorCalculation to it. When I did this, the form I'd created suddenly vanished from the developer. I had to shut it down and then restart it to get it back. Also, when I went to the calculation file for the table, it only had the single row colour calc calculation in it that I'd just created, when before there were 30 to 40 other calculations there. One of which was around 800 lines on its own.

Like I said above, this is the second time this has happened. Now I've got the hassle of recreating all those calculations again, which is going to take ages.

I'm using Servoy 4.1 with Sybase 10

Craig
craig-c
 
Posts: 38
Joined: Fri Mar 14, 2008 11:47 am

Re: problem with table calculations

Postby ngervasi » Thu Feb 26, 2009 8:48 pm

Argh, I've never seen anything like this, to be honest I never lost 1 line of code in 5 years. Must be something very specific to your repo/workspace.
Any errors in the Eclipse log file?
Maybe it's a good idea to create a case in the support system and attach a zipped copy of your workspace.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: problem with table calculations

Postby craig-c » Fri Feb 27, 2009 2:02 pm

Hi,

I have spent a bit more time looking into this problem since yesterday, and as a result have found what looks like a bug in Servoy.

Basically, I'm developing my solution on a Mac and I'm using time machine to back everything up every hour. This means that I could go back to yesterday, just before the problem occurred.

This enabled me to return the developer to the way it was yesterday afternoon, before the calculations got erased. This meant that I could then go through the same process again to see what happened. I will explain the steps I took yesterday (and this morning) below. These steps led to the loss of all my invoice calculations on both occasions.

1. In my solution I have a list view form that lists quotes. I also have a more or less identical list view form that lists invoices. These lists enable the user to access more detailed forms for individual quotes and invoices. I have separate tables and forms for quotes and invoices.

Anyway, yesterday I decided that I wanted to set up a rowBGColorCalculation for both of these list forms. This was so that I could have alternate colours in the rows in my lists, plus I could also give the selected row a unique colour to indicate its selection.

I therefore went through the process of changing my quote list form so that it could show these row colours. This involved making various modifications to the form. These included making all the fields in the quote list form transparent. I also made other minor modifications to the form. I then went to the rowBGColorCalculation property in the quote list form. I double clicked on its value field which brought up the 'Select script' pop-up. I then clicked on the create calculation button at the bottom of the pop-up. I then typed in the name for my new calculation. Finally, I went to the new calculation and typed in some code. I then (after saving) had a fully functional quote list form that showed row colours in the way that I had selected.

These steps all went without any problems. I didn't re-do these steps this morning because they had already been completed in the back up that I retrieved from time machine.

However, the following steps were what lead to the loss of all my invoice calculations. I also went through these steps again this morning, after retrieving the back up, and exactly the same problem occurred again (all my invoice calculations got erased - again).

2. I duplicated the quote list form. I renamed that new form 'invoice'. I changed its table to the invoice table. I also changed the data providers in its various fields, so that they corresponded to fields in the invoice table. I also changed the code in the forms methods so that it worked on invoices instead of quotes (I don't think that is an issue regarding this problem, but just thought I'd mention it to cover everything that I did).

FInally, I went to the rowBGColorCalculation property in the new invoice list form. I went through the same steps as discussed above: (creating a calculation for setting up the row colours). However, after typing in the name for the new calculation, I clicked the 'OK' button. This is when everything went wrong. To start with the form I was working on suddenly disappeared from the developer, even though it was the open (and visible) form when I clicked the 'OK' button. Also, the form wasn't available in the developer/workspace anymore. It had vanished without a trace. I had to shut down and then restart the developer to get it back. Also, the new calculation I had created had erased (overwritten) all of the other calculations in my invoice table (there were more than 30 of them, spanning many lines).

When this happened yesterday I was working on my own, so have no one else to confirm what I did. However, this morning I went through the same process with Bevil here in the office. He saw everything that I did, and he couldn't see anything wrong in what I did either.

From what I've said above, you should be able to see that this isn't a problem that always occurs with the rowBGColorCalculation property. After all I did the same thing with my quote list form and that didn't give the same problem. However, I have done the same thing with my invoice list form on two separate occasions, and the same problem occurred both times.

I am more than willing to send you exports, etc of the solution if you want to have a look at them. I can obviously create the the calculation through the table instead, and (hopefully) this will avoid the same problem happening again.

Also, previously, you said that you hadn't seen this sort of thing happening before. Maybe this is because you always create your calculations via the tables, instead of through a forms properties. Maybe that's why this hasn't become an issue yet. This is because most Servoy developers probably create their calculations via the tables, so don't really test this other approach out.

Craig
craig-c
 
Posts: 38
Joined: Fri Mar 14, 2008 11:47 am

Re: problem with table calculations

Postby ngervasi » Fri Feb 27, 2009 2:18 pm

I think that the problem is not linked to using the property to create a calculation, I have the feeling that is linked to the fact that you duplicated a form (maybe for some unknown reason/bug some UUIDs where not unique?) anyway if you have TimeMachine you should send 2 copies of your workspace (before the accident and after the accident) to servoy support, I'm sure that they will find the reason for the failure and they will fix it asap (as they always do).
Create a case in the support system and attach the zipped directories.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: problem with table calculations

Postby craig-c » Fri Feb 27, 2009 2:50 pm

Thanks for your feedback. I am now putting together some bits and pieces to send to Servoy support.

Also, I've just been through the process discussed above again, and the calculations actually seem to go missing at the point where I make the duplication, so your assumptions look to be correct.

Craig
craig-c
 
Posts: 38
Joined: Fri Mar 14, 2008 11:47 am

Re: problem with table calculations

Postby ngervasi » Fri Feb 27, 2009 2:58 pm

You're welcome, good thing that you have Time Machine, it's perfect for the servoy R&D team to debug this. :)
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: problem with table calculations

Postby lvostinar » Fri Feb 27, 2009 3:17 pm

Eclipse also has a local history functionality that you can use to get back to a previous version of the file. Maybe this helps. You don't have any duplicate uuid error markers in the workspace ? Weird things can happen in that case.
Laurian Vostinar
Servoy
lvostinar
 
Posts: 1062
Joined: Tue Feb 19, 2008 10:53 am

Re: problem with table calculations

Postby vincentc » Thu May 16, 2013 3:38 pm

I had the same problem.
It happens when you have several workspaces with calculation files having the same name.
To workaround this problem, you have to open your js file calculation file in Notepad, delete all the uuid comments, save the file, and restart Servoy Developer.
vincentc
 
Posts: 56
Joined: Thu Aug 25, 2011 11:12 am

Re: problem with table calculations

Postby gdurniak » Mon Nov 11, 2019 5:40 pm

Servoy 7.3.4

Same here. Added a Table calculation ( TEXT ), saved it, and ALL the calculations for that Table disappeared.

I had to do a "Clean" Import of my last Solution File, activate it, open the mytable.js file ( as Text ), and Copy / Paste the calculations back into the current Solution ( as Text )

Some say it's because duplicates of this or that exists, but that's no excuse ( I have no "Problems" or Errors )

This is a very nasty bug

greg
File Shoppe
gdurniak
 
Posts: 232
Joined: Thu Jul 08, 2004 7:25 pm
Location: Bayside, NY, USA


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 10 guests

cron