locked
USD issues with events and parameter RRS feed

  • Question

  • Hi,

    I'm trying to get a telephony integration up in USD and are sort of new to the USD. The integration isn't handled with the listener but gets events from a hosted controll and I'm trying to get the accounts search from that event happening.

    My current solution is that I hook an action call to the event which is calling an entity search with a fetxhXML with replacement parameters but the parameters aren't being replaced.

    Here's the fetch:

    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">  
      <entity name="account">    
        <attribute name="name" />    
        <attribute name="telephone1" />    
        <attribute name="emailaddress1" />    
        <attribute name="accountid" />    
        <order attribute="name" descending="false" />    
        <filter type="and">      
          <filter type="or">         
            <condition attribute="new_mobilephone" operator="eq" value="[[ciq_destination]]" />         
            <condition attribute="new_mobilenumber" operator="eq" value="[[ciq_destination]]" />         
            <condition attribute="telephone2" operator="eq" value="[[ciq_destination]]" />         
            <condition attribute="telephone1" operator="eq" value="[[ciq_destination]]" />       
          </filter>    
        </filter>  
      </entity>
    </fetch>

    and the error message

    27:55.86 Microsoft.Crm.UnifiedServiceDesk.Dynamics Error: 2 : 27:55.86 EntitySearchService :Search failed because the replacement parameters in the FetchXML weren't replaced.CTIAccountSearch
    27:55.86 Microsoft.Crm.UnifiedServiceDesk.Dynamics Error: 2 : 27:55.86 Error occurred when running DoSearchAction : System.Exception: EntitySearchService :Search failed because the replacement parameters in the FetchXML weren't replaced.CTIAccountSearch
       at Microsoft.Crm.UnifiedServiceDesk.Dynamics.EntitySearch.EntitySearchService.CheckError(Func`1 errorCondition, String errorMessage)
       at Microsoft.Crm.UnifiedServiceDesk.Dynamics.EntitySearch.EntitySearchService.GetEntitySearchResultsUtil(EntitySearchRequest entitySearchRequest, Action`1 callbackMethod, Boolean isAsync)
    27:55.86 Microsoft.Crm.UnifiedServiceDesk.Dynamics Error: 2 : 27:55.86 Message: Exception Generated in ExecuteActions
    Source    : Microsoft.Crm.UnifiedServiceDesk.Dynamics
    Method    : <DoSearchAction>b__5d
    Date    : 09:27:55
    Time    : 2016-05-10
    Error    : EntitySearchService :Search failed because the replacement parameters in the FetchXML weren't replaced.CTIAccountSearch
    Stack Trace    : at Microsoft.Crm.UnifiedServiceDesk.Dynamics.CRMGlobalManager.<>c__DisplayClass5f.<DoSearchAction>b__5d(EntitySearchResponse entitySearchResponse)
       at Microsoft.Crm.UnifiedServiceDesk.Dynamics.EntitySearch.EntitySearchService.GetEntitySearchResultsUtil(EntitySearchRequest entitySearchRequest, Action`1 callbackMethod, Boolean isAsync)
       at Microsoft.Crm.UnifiedServiceDesk.Dynamics.CRMGlobalManager.DoSearchAction(RequestActionEventArgs args)
       at Microsoft.Crm.UnifiedServiceDesk.Dynamics.CRMGlobalManager.DoAction(RequestActionEventArgs args)
       at Microsoft.Uii.Csr.Aif.HostedApplication.HostedWpfControl.HandleRequestAction(Object sender, RequestActionEventArgs args)

    I have a displaymessage call that is working with the parameters coming in so they seem to be there but not when I'm doing the search. I've set the parameter depth to 2, don't know if that applies, there's not that much documentation available IMHO

    Thanks!


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Tuesday, May 10, 2016 7:50 AM

All replies

  • Hi Rickard,

    did you happen to resolve this issue? I am encountering the exact same problem and so far I have not been able to solve it.

    Thanks!

    Luca

    Wednesday, December 21, 2016 11:22 AM
  • Hey posting here brought me luck! I have actually solved the issue.

    You can use the action CopyToContext of CRM Global Manager to copy your event-related parameters using the normal syntax, then launch the search using [[$Context.yourCopiedVariable]], which doesn't seem to corrupt the replacement parameter mechanism for the xml query. This is a nice workaround, but it doens't explain why it didn't work in the first place.

    Cheers

    Wednesday, December 21, 2016 11:43 AM
  • Hey Luca,

    Nice that you found a solution, I sort of dropped that one since the project changed direction. I think I used something similar at one time but there was some sort of issue with using that work around which I can't remember what it was now.

    Hope it works out for you!

    Regards


    Rickard Norström Developer CRM-Konsulterna
    http://www.crmkonsulterna.se
    Swedish Dynamics CRM Forum: http://www.crmforum.se
    My Blog: http://rickardnorstrom.blogspot.se

    Wednesday, December 21, 2016 11:56 AM