Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FetchXML in Dynamics CRM 2011

    Hi all,

    I need in CRM 2011 to get the count of child records that are related to the parent entity and show the count in a field on the form of the parent entity.

    I have developed some javascript with some fetchXML in it and as far as i am aware it should work. What i dont know how to do is take the fetchXML and get the actual count from it. I've seen a few examples of it around but none really show what you need to do clearly.

    I'll post what i have so far for if it might help:

    Code:
    function GetChildCount()
    {
    var solutionName = Xrm.Page.getAttribute("ts_descriptor").getValue();
    
    var fetchXml = '<fetch mapping="logical" count="25" returntotalrecordcount="true">'
    fetchXml += '<entity name="ts_solution_area_specialist">'
    fetchXml += '<attribute name="ts_specialist_user_id" />' 
    fetchXml += '<attribute name="ts_solution_area_id" />' 
    fetchXml += '<attribute name="ts_solution_area_specialistid" />' 
    fetchXml += '<order attribute="ts_specialist_user_id" descending="false" />' 
    fetchXml += '<filter type="and">'
    fetchXml += '<condition attribute="ts_test" operator="eq" value="717750000" />' 
    fetchXml += '<condition attribute="ts_solution_area_id" operator="eq" uiname="'
    fetchXml += solutionName
    fetchXml += '" />'
    fetchXml += '</filter>'
    fetchXml += '</entity>'
    fetchXml += '</fetch>'
    
    }
    Thanks

  • #2
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can anyone help?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •