Having Trouble With Stored Calc

Sorry to keep bugging guys, but I’m having some problems.

I have a stored and an unstored calc that have the same method:

return utils.stringMiddle(payment_type_full, 1,
utils.stringPosition(payment_type_full, ‘:’,1, 1)-1);

THe Unstored calc is calculating and showing it’s value. The Stored calc is not.

I tried to use the Databasemanager.recalculate(Founset); command, but it does not seem to be doing anything. Sorry to act like a dummy, but I’m at a loss.

Thanks,
Lee Snover

Lee,

Is the calculation set to return the same data type as the field in your stored calcutation? If the field is a “Number”, the calc must return a “Number”. If the field is “Text”, the calc must return “Text”.

This is the only thing I can think of off hand.

airmark:
Lee,

Is the calculation set to return the same data type as the field in your stored calcutation? If the field is a “Number”, the calc must return a “Number”. If the field is “Text”, the calc must return “Text”.

This is the only thing I can think of off hand.

Greg:

The Stored field and Unstored field types are Text, you can see the Calc above, so I think that is not the problem.

Thanks,
Lee

Does “payment_type_full” have a value in it?

In general - when you use a calc - you should do this:

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

Is good for debugging as well.

bcusick:
Does “payment_type_full” have a value in it?

In general - when you use a calc - you should do this:

if(payment_type_full)

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




Is good for debugging as well.

Bob:

Yes, the field is populated in every case. I’ll try your version.

Tried it. If I EDIT the “Payment_type_full” field, it recalculates. If I try to run databaseManager.recalculate(foundset); from a menu, it does not seem to do anything. How do I get the entire set to recalculate. I’m missing something here.

Regards,
Lee