Can Not Update Data with Methods

Lee, we are loosing focus of your original problem. Let’s start from scratch.

If I get you right, you have a calc that looks like this:

if(payment_type_full)
{
return utils.stringMiddle(payment_type_full, 1, utils.stringPosition(payment_type_full, ':',1, 1)-1);
}
else
{
return 'NOT VALID';
}

and you want this calc to be stored. Is that what you want to do?

If yes, I have these questions:

  1. the name of the calc is the same as the column (and you see the stored checkbox)?
  2. the datatype of your calc is the same as your column?
  3. Is the column long enough for the result to fit?
  4. Do you see a warning triangle in the lower left corner of the screen, and if yes, what does it say if you click on it?

Please be sure, we get this working :lol:

patrick:
Lee, we are loosing focus of your original problem. Let’s start from scratch.

If I get you right, you have a calc that looks like this:

if(payment_type_full)

{
return utils.stringMiddle(payment_type_full, 1, utils.stringPosition(payment_type_full, ‘:’,1, 1)-1);
}
else
{
return ‘NOT VALID’;
}




and you want this calc to be stored. Is that what you want to do?

If yes, I have these questions:

1. the name of the calc is the same as the column (and you see the stored checkbox)?
2. the datatype of your calc is the same as your column?
3. Is the column long enough for the result to fit?
4. Do you see a warning triangle in the lower left corner of the screen, and if yes, what does it say if you click on it?

Please be sure, we get this working <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" />

Patrick:

  1. Yes, cofirmed, including the checkbox.
    2,3. Yes, type is text, 50 chars. Maximum value is less then that.
  2. No warning triangles.

Thanks,
Lee Snover

And if you make a calc with a different name (unstored), you see the proper result?

leesnover:

patrick:
Lee, we are loosing focus of your original problem. Let’s start from scratch.

If I get you right, you have a calc that looks like this:

if(payment_type_full)

{
return utils.stringMiddle(payment_type_full, 1, utils.stringPosition(payment_type_full, ‘:’,1, 1)-1);
}
else
{
return ‘NOT VALID’;
}




and you want this calc to be stored. Is that what you want to do?

If yes, I have these questions:

1. the name of the calc is the same as the column (and you see the stored checkbox)?
2. the datatype of your calc is the same as your column?
3. Is the column long enough for the result to fit?
4. Do you see a warning triangle in the lower left corner of the screen, and if yes, what does it say if you click on it?

Please be sure, we get this working <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" />

Patrick:

  1. Yes, cofirmed, including the checkbox.
    2,3. Yes, type is text, 50 chars. Maximum value is less then that.
  2. No warning triangles.

Thanks,
Lee Snover

Patrick:

I got stacktracing going with some help from Jan. from what I can see, the SQL statement is NOT updating the Stored Calc field which is consistent with my experience. If I edit the field manually, the related calculation is updated in Servoy, but if I refind the record it is back to Null. The SQL is only updating the field that I manually edit.

I’ve sents some samples off to Jan, so hopefully I can get this resolved.

Thanks,
Lee

What Servoy version are you using? There have been some calc issues before…

patrick:
What Servoy version are you using? There have been some calc issues before…

The latest beta 2.2RC6

hmm. This still sounds weird, because it works for all of us but you. It has to be something minor that you are missing.

I guess the master will fix it :lol:

patrick:
hmm. This still sounds weird, because it works for all of us but you. It has to be something minor that you are missing.

I guess the master will fix it :lol:

Patrick:

When you update a field, does Servoy issue an SQL update against all of the tables calculated values? From what I can see in the tracelog, that’s not happening in my solution at the moment. I need to do some more tests, but I’m very pressed for time at the moment.

I’m trying to resolve some performance issues in my FM7 solution, long enough to get a prototype going in Servoy. I don’t think FM7 is going to cut it much longer for us, at least for our main application. It’s a great tool for smaller data sets.

Regards,
Lee

Patrick:

FYI, I did a test in a simpler file I have in the same solution, in that table, when I update the related field, the SQL trace clearly shows the stored calculation being updated. So my guess is there is some kind of a bug affecting this particular table.

It just figures with me, my first real crack at something basic, and I have to find a problem that drives me nuts for hours on end! ;-) Good thing I enjoy programming, at least most of the time. :?

Regards,
Lee