Skip to Content
avatar image
Former Member

changing attribus in PowerDesigner via vba-script

Hello,

I'm trying to copy the comment of a column of a table to the description of the same column. My script:

option explicitDim kind, name, obj, c, a
kind = InputBox("(T)able or (V)iew")
name = InputBox("Enter name")
If kind = "T" Then
Set obj = ActiveModel.FindChildByName(name, cls_table)
ElseIf kind = "V" Then
Set obj = ActiveModel.FindChildByName(name, cls_view)
End If
For each c in obj.columns
c.SetAttribute "Description", c.comment
Next

The problem is that I can see the new description when I open the column-object and look under "description", but can't see it in the table browser under "description". To see it there, I have to open every column an close it with the ok-button. Then the description appears in the table browser. Has it something to do with the object-hierarchy?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 20, 2017 at 04:19 PM

    I just try the code in 16.6 SP03 and it works fine.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 23, 2017 at 07:08 PM

    This issue also occurs if you import descriptions using the Excel Import. The Description is visible in a list of objects if you include "Description Text", but not if you show the Description. I fix it by making any change to the object - I think that running validation event handlers also does the job.

    Add comment
    10|10000 characters needed characters exceeded