1

How do I return all entities without using entity.GetFilters() ? I have the following and I can only seem to produce a FilterCollection. I would much rather have just all the enities because i am trying to do some client side lookups.

Here is my code below.

    Microsoft.BusinessData.MetadataModel.Entity entity =                         
    clientContext.Web.GetEntity(businessDataField.EntityNamespace, 
    businessDataField.EntityName);


    Microsoft.BusinessData.MetadataModel.LobSystem lobSystem = entity.GetLobSystem();
    Microsoft.BusinessData.MetadataModel.Collections.LobSystemInstanceCollection lobSystemInstanceCollection = lobSystem.GetLobSystemInstances();
    clientContext.Load(lobSystemInstanceCollection);
    clientContext.ExecuteQuery();
    Microsoft.BusinessData.MetadataModel.LobSystemInstance lobSystemInstance = lobSystemInstanceCollection[0];        
    clientContext.Load(entity);
    clientContext.ExecuteQuery();


    Microsoft.BusinessData.MetadataModel.Collections.FilterCollection fCollection = entity.GetFilters(readListInstanceName); 

This example I have been using works well to get a specific item from the BCS. However, i don't have the identity of the item all the time. The user supplies a more user friendly value to the system. This is why I need to do a brute force lookup.

  Microsoft.BusinessData.Runtime.EntityIdentity identity = new  
   Microsoft.BusinessData.Runtime.EntityIdentity(clientContext, new object[] {95});
    clientContext.Load(identity);
    Microsoft.BusinessData.Runtime.EntityInstance instance = entity.FindSpecific(identity, "Read Item", lobSystemInstance);
    clientContext.Load(instance);
    clientContext.ExecuteQuery();

I have also found this method

   var identifiers = entity.GetIdentifiers();

This lets me know what values to create the EntityIndentifier on but still don't know how to get the Identity value for my column when the user can choose to display any number of the fieldvalues they choose.

  • What happens when the number of entities exceeds the BCS throttle limits? – Paul Schaeflein Apr 24 '14 at 17:01
  • the entity.EstimatedInstanceCount returns 10,0000 but the EntityInstanceCollection contains zero elements when a limit and wildcard filter is applied. If only the limit filter is applied then it returns all values up to limit. I place an * for the default value of the wildcard filter but still nothing is returned. I did not config the BCS throttle limits. – monkeyjumps Apr 24 '14 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.