0

I can search member by EntityMembersGetCriteria where SearchTerm containing expressions for custom attributes for exampel 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'.

Any idea pls?

beewest
  • 4,486
  • 7
  • 36
  • 63
  • Is the issue that it is not recognizing 'SAP Code' but is recognizing 'Code';or it is not finding 'abc' and is finding 'xyz'? – jdweng Mar 11 '19 at 09:18
  • Name and Code are builtin attributes in MDS. I can not search with this 2 attributes but can do with others. – beewest Mar 12 '19 at 00:41

1 Answers1

0

SearchTerm sets WHERE clause search criteria to filter records. That means it is needed to put exactly the same names as it is stored in the MDS DB.

The point is that the user defined attributes (UDA) have special names in MDS DB.

Every UDA attributes is stored in the following format: uda_{Entity.InternalId}_{Attribute.InternalId}, for example uda_2012_45231. In case of Entity.InternalId = 2021 and Attribute.InternalId = 45231.

So you have write into SearchTerm:

"uda_2012_45231 = 'abc'"

P.S.: You can find the values of the Entity and Attribute InternalIds within MetadataGet method.

UPDATE: It seems that UDA attributes do not work within SearchTerm at all. "Name", "Code", "EnterDTM" (CreatedDateTime) and "LastChgDTM" (UpdatedDateTime) are working, but the UDA are not.

Lkor
  • 434
  • 3
  • 12