locked
Querries never work - HTTP-Status 400:Bad Request RRS feed

  • Question

  • My querries never work. No mather how simply I construct them, they're never executed properly.

    The plugin itself works fine. Thats my code. EntityName is correct, thats the name of my enitity, not the display name.

                            QueryExpression q = new QueryExpression();
                            q.EntityName = "iq_inventar";
    
                            RetrieveMultipleRequest request = new RetrieveMultipleRequest();
                            request.ReturnDynamicEntities = true;
                            request.Query = q;
    
                            RetrieveMultipleResponse retrieved = (RetrieveMultipleResponse)service.Execute(request);
    
    The error message that is produced when called service.execute(request) is HTTP-Status 400:Bad Request

    What could be the reason why its fails?
    Wednesday, December 9, 2009 11:24 AM

Answers

  • Joey, I found it out. The Organisation name had been changed, when it was deployed the first time. So my ICRMservice "service" was wrongly initialized. Instead of ICRMservice, I'm using now CRMservice and it works.

    Wednesday, December 9, 2009 12:46 PM

All replies

  • Forgot to import the Microsoft.Crm.Sdk.Query library? Or the System.Data.OleDb library?
    • Proposed as answer by Joey VDB Wednesday, December 9, 2009 12:27 PM
    Wednesday, December 9, 2009 12:27 PM
  • Joey, I found it out. The Organisation name had been changed, when it was deployed the first time. So my ICRMservice "service" was wrongly initialized. Instead of ICRMservice, I'm using now CRMservice and it works.

    Wednesday, December 9, 2009 12:46 PM
  • Thats good to know!
    I already thought that you didn't forget the imports.

    I will unmark my post as answer.
    Could you mark your answer as final? For the other viewers ;-).
    Wednesday, December 9, 2009 12:48 PM