locked
Joining Two Entities and retreiving result RRS feed

  • Question

  • Here is my question

    I have account entity and the address entity, account entity has one to many relation with the address entity. I have search text box which is used to take the input from the user. Suppose user enter some text "ABC" now what I want is to check the account name which contain "ABC" and also the address field suppose Street 1 to Contain "ABC". How can I do that

    1- if the ABC is not found in the account name and found in the address field can I get the some fields of account and some fields of address ?

    2- I have tried queryExpression with linkEntity and also fetch xml as well but didn't get required result

    thanks in advance. Please reply me as soon as possible.

     

    I am using Silverlight 4 and C# and I have added my .xap file as web resource in the CRM 2011


    Please mark the replies as answers if they help. Asim Sajjad Software Engineer http://asimsajjad.blogspot.com

    • Edited by Asim Sajjad Saturday, October 29, 2011 5:42 AM
    Saturday, October 29, 2011 5:41 AM

Answers

  • It's not possible,

    The way query expression and fetch xml works, it does not allow you to use "or operator" between conditions of main entity and linked entity.

    If you are using silverlight and using obserbable collection for accounts, I would suggest create two seperate queries and store the end results in the obserbable collection. You can do all sort of operations on obserbable classes like sorting , filtering etc.

    I hope this helps.

     


    Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com
    • Marked as answer by Asim Sajjad Tuesday, November 1, 2011 6:35 AM
    Saturday, October 29, 2011 12:03 PM

All replies

  • It's not possible,

    The way query expression and fetch xml works, it does not allow you to use "or operator" between conditions of main entity and linked entity.

    If you are using silverlight and using obserbable collection for accounts, I would suggest create two seperate queries and store the end results in the obserbable collection. You can do all sort of operations on obserbable classes like sorting , filtering etc.

    I hope this helps.

     


    Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com
    • Marked as answer by Asim Sajjad Tuesday, November 1, 2011 6:35 AM
    Saturday, October 29, 2011 12:03 PM
  • It's not possible,

    The way query expression and fetch xml works, it does not allow you to use "or operator" between conditions of main entity and linked entity.

    If you are using silverlight and using obserbable collection for accounts, I would suggest create two seperate queries and store the end results in the obserbable collection. You can do all sort of operations on obserbable classes like sorting , filtering etc.

    I hope this helps.

     


    Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com
    • Proposed as answer by Amreek Singh Saturday, October 29, 2011 12:03 PM
    Saturday, October 29, 2011 12:03 PM
  • I have that thing in my mind but what if I have to use the paging then for example I have page size of 50 and both queries result after removing the duplicate values from the result have more then 50, the problem is the paging. by this paging will effect

    I am looking for a solution which also help me in paging.

    Need your though regarding using Linq will that help me in my query I have not use it but I am thinking of using it.

     


    Please mark the replies as answers if they help. Asim Sajjad Software Engineer http://asimsajjad.blogspot.com
    Saturday, October 29, 2011 12:35 PM