简体   繁体   English

通过内置属性代码搜索主数据服务成员

[英]search master data service member by builtin attribute code

I can search member by EntityMembersGetCriteria where SearchTerm containing expressions for custom attributes for exampel SAP Code = 'abc' .我可以通过EntityMembersGetCriteria搜索成员,其中SearchTerm包含示例SAP Code = 'abc'自定义属性表达式。

var criteria = new EntityMembersGetCriteria
        {
            ModelId = new Identifier { Name = Model },
            EntityId = new Identifier { Name = Entity },
            VersionId = new Identifier { Name = Version },
            SearchTerm = searchTerm,
            MemberType = MemberType.Leaf,
            MemberReturnOption = MemberReturnOption.DataAndCounts
        };

However it does work with Code='xyz' .但是它确实适用于Code='xyz'

Any idea pls?有什么想法吗?

SearchTerm sets WHERE clause search criteria to filter records. SearchTerm 设置 WHERE 子句搜索条件来过滤记录。 That means it is needed to put exactly the same names as it is stored in the MDS DB .这意味着需要输入与 MDS DB 中存储的名称完全相同的名称

The point is that the user defined attributes (UDA) have special names in MDS DB .关键是用户定义的属性 (UDA) 在 MDS DB 中有特殊名称

Every UDA attributes is stored in the following format: uda_{Entity.InternalId}_{Attribute.InternalId} , for example uda_2012_45231.每个 UDA 属性都以以下格式存储: uda_{Entity.InternalId}_{Attribute.InternalId} ,例如 uda_2012_45231。 In case of Entity.InternalId = 2021 and Attribute.InternalId = 45231.如果Entity.InternalId = 2021 和Attribute.InternalId = 45231。

So you have write into SearchTerm:所以你已经写入 SearchTerm:

"uda_2012_45231 = 'abc'"

PS: You can find the values of the Entity and Attribute InternalIds within MetadataGet method . PS:您可以在MetadataGet 方法中找到 Entity 和 Attribute InternalIds 的值。

UPDATE : It seems that UDA attributes do not work within SearchTerm at all.更新:似乎 UDA 属性在 SearchTerm 中根本不起作用。 "Name", "Code", "EnterDTM" ( CreatedDateTime ) and "LastChgDTM" ( UpdatedDateTime ) are working, but the UDA are not. “名”, “密码”, “EnterDTM”(CreatedDateTime)“LastChgDTM”(UpdatedDateTime)正在努力,但UDA都没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM