Kbase 19760: ADM2 - Calculated Fields / SDB with Updatable Source Fields
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  6/12/2007 |
|
Solution ID: 19760
GOAL:
ADM2: Calculated fields in a SmartDataBrowse(SDB) with updateable source fields
FACT(s) (Environment):
Progress 9.x
SYMPTOM(s):
Calculated fields in a SmartDataBrowse (SDB)
ADM2
CAUSE:
Any Progress Version 9 release prior to 9.1A10 contains a SmartDataBrowse bug that causes the problem.
FIX:
If you create a SDB that contains a calculated field and the
calculation is based on the contents of an updateable field in the
SDB, you must format the expression in a very specific way, otherwise
the calculated field is not be updated properly and you may receive
run-time errors from the SDB.
For example, if you create a calculated field on the Order Line table
to show the extended price based on quantity * price, your expression
for the calculated field would be something like:
Qty * Price @ deExtendedPrice
where deExtendedPrice is a variable that you defined in the definitions section of the SDB.
To enable this expression to work with SmartDataBrowser, the ADM2 code
parses the list of displayed and enabled fields to produce a list of field names that have to be displayed. In earlier Progress versions, this parsing did not apply to calculated fields. An update to any of the fields in the browse resulted in an error.
From Progress Version 9.1A10 and later, the code knows to treat
the calculated fields in a special way. The parser looks for the @ sign and replaces the expression with a token. To do this, the parser anticipates that the expression will always be in the form:
(expression) @ variable
In other words, you must enclose the expression portion in parentheses and use only one space between @ and the variable. The example above is now:
(Qty * Price) @ deExtendedPrice
Unfortunately the AppBuilder's Expression Builder does not yet verify
this syntax. As a result, it is possible to enter an expression in
the Expression Builder that will result in run-time errors.