Kbase 18885: ADM2 - What Does The columnReadOnly Function Do?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Unverified
FACT(s) (Environment):
Progress 9.x
SYMPTOM(s):
ADM2
FIX:
The columnReadOnly function accepts a field name as a parameter and returns True if the field is defined as being updateable, and False if it is not.
This function can be used to verify that a field can be modified before adding it to the pcValueList variable in the submitRow function. It can also be used within a SmartDataViewer or SmartDataBrowser to determine whether to enable or disable fields.
This sample code shows how to use the columnReadOnly function within the submitRow function in a SmartDataObject to update the CreditLimit
field, only if it is marked as being updateable.
/* The following code should be placed in the submitRow function */
/* before the standard behavior. It tries to enforce an automatic */
/* modification to the CreditLimit field if the field is marked as */
/* updateable. We increase the CreditLimit by 25% (hey, everybody */
/* deserves a credit limit increase!). This increase will only */
/* take place during an update of an existing record. */
IF getNewRow() = False THEN
IF columnReadOnly("CreditLimit") = False THEN
ASSIGN pcValueList = pcValueList
+ CHR(1)
+ "CreditLimit"
+ CHR(1)
+ STRING(RowObject.CreditLimit * 1.25).
ELSE
DO:
RUN addMessage("Can't Modify Credit Limit","","").
RETURN False.
END.