HP Quality Center field names

非 Y 不嫁゛ 提交于 2019-11-29 17:23:50

When you get an entity field value, the field must be the underlying database column name for that entity. You can discover this using the project customization UI in HP ALM: select project entities then explore the system or user fields. Beware that the Design Step says the column name begins ST_... it doesn't. It's actually DS_...

You can also get this information programmatically. Given a factory instance use the equivalent of:

private void ExploreFactoryFieldDefinitions(IBaseFactory factory)
    {
        List fields = factory.Fields;

        foreach (TDField field in fields)
        {
            FieldProperty field_property = (FieldProperty)field.Property;

            if (field_property.IsRequired)
            {
                Log(String.Format("User Label: {0}\n", field_property.UserLabel));
                Log(String.Format("User Column Type: {0}\n", field_property.UserColumnType));
                Log(String.Format("DB Column Name: {0}\n", field_property.DBColumnName));
                Log(String.Format("DB Column Type: {0}\n", field_property.DBColumnType));
                Log(String.Format("DB Table Name: {0}\n", field_property.DBTableName));
            }
        }
    }

field_property.UserLabel gives you the user friendly field name. field_property.DBColumn name gives you the database column name that should be used with entity[field_name].

BTW - don't forget to call entity.Post() to have your changes saved. When working with a versioned project you have a few more hoops to jump through too. Good luck!

I think, the field you are looking for is CY_COMMENT (hint). Maybe there is a better way—but you can find the names of the fields in the Query Builder. If you create an Excel Report and open the Query Builder, there is an Entities View which shows all the fields of the tables (even the user-defined fields). Maybe there is some kind of database documentation which gives you the same thing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!