locked
PreFilteredLookup with linked entity RRS feed

  • Question

  • Hi,

    I'm using the http://mscrmfilteredlookup.codeplex.com/

    I want to use prefiltered lookup.

    var fetchStr = "<filters>"

        + "<filter entity='new_agreement'"

        + "><condition attribute='new_customerid'"

        +"operator='eq'"

        + "value=“{GUID}“/></filter></filters>";

     

    myField.AddParam('filters', fetchStr);

     

    It’s working. I don’t know how to build the reuqest for the link entity:

    I have an n:n relationship and I build the fethch request.

     

    var fetchStr = "<fetch mapping='logical'>"

         + "<all-attributes/>"

         + "<entity name='new_entity2'>"

         + "<link-entity name='new_new_entity2_new_entity1' from='new_entity2id' to=’new_entity2id’>"

         + "<filter type='and'>"

         + "<condition attribute='new_entity1id' operator='eq' value='{GUID}'/>"

         + "</filter>"

         + "</link-entity>"

         + "</entity>"

         + "</fetch>";

     

    myField.AddParam('filters', fetchStr);

     

    The code does not work.

    I should write the fetchStr with “<filters>” and not with "<fetch mapping='logical'>". How can I convert the request?

     

     

     

     thanks in advance

    Sebastian

     

     

    Thursday, January 27, 2011 3:18 PM

Answers

All replies

  • Hello Sebastian.

     

    I worked with this filtered lookup and it would not work with linked items by-design...

    I know this because I used reflector and investigated it. To make it possible you have to redevelop it.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    • Marked as answer by Jim Glass Jr Thursday, January 27, 2011 3:30 PM
    Thursday, January 27, 2011 3:26 PM
    Moderator
  • Is this to defficult to develop?

    Thursday, January 27, 2011 3:34 PM
  • From my point of view it can take the day of the development. This plugin is tricky one inside.
    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Thursday, January 27, 2011 3:40 PM
    Moderator
  • Could you help us by development this plugin?

     

     

    Thursday, January 27, 2011 4:01 PM
  • Sebastian,

    Check you email please.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Thursday, January 27, 2011 4:13 PM
    Moderator
  • First, let me apologize for the late response, just came across this question.

    Andriy: 

    1. Why did you use reflector? my code is open sourced on codeplex, you could just download it and play with it.

    2. Did you solve the above problem? if you want to, you can commit a patch, and i ill include it in the source code and publish it. 

     

    Regarding this, i have a question for anybody else who might be using my plugin. 

    I've been playing with the idea to include another feature: "fetchxml" param, that when specified, will replace the fetchxml query generated by the CRM all together.  While a bit dangerous (i can do some validations on the fetchxml the develeoper is giving me, but he can still hurt himself really bad if he tries to :)), it will help solve complicated scenarios like the one specified here.

    Do you thing that this feature is needed?  Any other feature you think is a must, or another way to solve this kind of issues? 

    Tuesday, April 12, 2011 6:06 AM