Answered EntityMembersGet using version flag.

  • Friday, November 16, 2012 2:31 PM
     
     

    All,

    I am using WCF to get members of an entity from MDS using below code: -

    MemberIdentifier memberIdentifier = new MemberIdentifier();
    EntityMembersGetRequest getRequest = new EntityMembersGetRequest();
    getRequest.MembersGetCriteria = new EntityMembersGetCriteria();
    getRequest.MembersGetCriteria.ModelId = new Identifier { Name = modelName };
    getRequest.MembersGetCriteria.VersionId = new Identifier { Name = versionName };
    getRequest.MembersGetCriteria.EntityId = new Identifier { Name = entityName };
    getRequest.MembersGetCriteria.MemberType = memberType;
    getRequest.MembersGetCriteria.MemberReturnOption = MemberReturnOption.Data;
    getRequest.MembersGetCriteria.SearchTerm = "Code = '" + memberCode + "'";
    EntityMembersGetResponse getResponse = clientProxy.EntityMembersGet(getRequest);

    The results are as expected. Based on the above code, i am fetching data based on versionName (i.e, VERSION_1, VERSION_2 etc). But i would need to get the data using version flags. Hardcoding the versionNames as VERSION_1 would be a problem later on. VERSION_1 might not be the latest version always. Hence i would want to use the versionflags. Could somebody help me with the same?

All Replies

  • Friday, November 16, 2012 6:03 PM
    Moderator
     
     Answered

    Hi Nagesh,

    This is not possible. You will need to manage the latest relevant version in your application by querying for it before doing the EntityMembersGet.

    Thanks,

    Tomer (MSFT).


  • Wednesday, November 21, 2012 1:17 PM
     
     

    Thanks Tomer,

    Could you please share the code to get the latest version of a model if you have it handy?

    Regards,

    Nagesh CL