1
0
-1

Version 9.7.04 G422


If I set $FieldProperties on a read to store an original value and never set $FieldProperties again for the field, my value is retained.

However, after setting the value, if I store another property, such as BackColor, my original value property disappears.


Example:

In initial Proc:

$FieldProperties(Receipt_Volume.Table_Name) = "OriginalValue=%%nReceiptVolume%%%"


In some other Proc :

sProperties = $FieldProperties(Receipt_Volume.Table_Name)

GetItem/Id nNomOriginalValue, sProperties, "OriginalValue"

-- Works just fine


In another Proc to change BackColor if data has changed:

$FieldProperties(Receipt_Volume.Table_Name) = "BackColor=SomeColor"

-- Set BackColor ok, but OriginalValue is lost

-- Anywhere afterwards sProperties = $FieldProperties(Receipt_Volume.Table_Name) only has BackColor Info


Version 9.7.04 G422

    CommentAdd your comment...

    4 answers

    1.  
      1
      0
      -1

      Hello Rob,

      The described behavior is normal. With the mentioned statement you always overwrite all field properties. In case you only want to update one (or more) specific properties then you need to specify this with the PropertyList parameter. E,g,


      $FieldProperties(Receipt_Volume.Table_Name, "OriginalValue") = "OriginalValue=%%nReceiptVolume%%%"
      $FieldProperties(Receipt_Volume.Table_Name, "BackColor") = "BackColor=SomeColor"


      For more details see the doc:

      > Uniface Reference > ProcScript Reference > Proc: Functions > $fieldproperties

      I hope this helps.

      Kind regards,

      Daniel Iseli
      Uniface Technical Support

        CommentAdd your comment...
      1.  
        2
        1
        0

        Hi Rob,

        As you have discovered setting the value of $fieldproperties you replace all the current values

        There are a number of ways of achieving what you are looking for

        1. Add to or replace an item in the list
          putitem/id  $FieldProperties(Receipt_Volume.Table_Name), "BackColor", "SomeColor"
        2. Specify the item(s) to replace
          $FieldProperties(Receipt_Volume.Table_Name, "BackColor") = "BackColor=SomeColor"

        Regards,

        Mike

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Thank you all!  Working great now.  Been working with Uniface for 21 years and just recently began making use of the advanced Properties.

            CommentAdd your comment...
          1.  
            1
            0
            -1

            Hi Rob

            $fieldproperties (and other "proerties" too)  are just simple UnifAce-Item-Lists (UIL)
            So you can modifiy/read them by

            • putitem/id
            • delitem/id
            • getitem/id
            • $item()
            •  ..and so on

            Ingo


              CommentAdd your comment...