locked
CRM 2015: C# WFA Plugin fetchxml result is staying cached RRS feed

  • Question

  • I have created a plugin through visual studio.

    Here are the important parts of my code

    protectedoverridevoidExecute(CodeActivityContextparam_executionContext)

    {

    this.executionContext = param_executionContext;

    tracingService = executionContext.GetExtension<ITracingService>();

    IWorkflowContextcontext = executionContext.GetExtension<IWorkflowContext>();

     IOrganizationServiceFactoryserviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();

    service = serviceFactory.CreateOrganizationService(context.UserId);

    }

               

    stringfetchXMLString_HelpDesk =

                                     

    "<fetch mapping='logical'>"+

                                          

    "<entity name='tsi_helpdesk'>"+

                                             

    "<attribute name='activityid' />"+

                                   

    "<attribute name='actualend' />"+

                                             

    "<filter type='and'>"+

                                                

    "<condition attribute='activityid' operator='eq' value='"+ helpDeskID + "' />"+

                                             

    "</filter>"+

                                          

    "</entity>"+

                                       

    "</fetch>";

               

    EntityCollectionentCollection_HelpDesk = service.RetrieveMultiple(newFetchExpression(fetchXMLString_HelpDesk));

               

    if(entCollection_HelpDesk.Entities.Count > 0)

    {

           entity_helpdesk = entCollection_HelpDesk.Entities[0];

                   

    if(entity_helpdesk.Attributes.Contains("actualend"))

    {

           

    //////// THE CODE NEVER COMES HERE

     helpDeskActualEndTime = entity_helpdesk[

    "actualend"].ToString();

                    }

                }

    Refer to the part

     /////////// THE CODE NEVER COMES HERE

    So, the first time when the helpdesk activity is active the code does not hit. But when I resolve the activity  and I see in the db that there is a value for actualend - the code still does not get hit.

    I have a feeling its staying cached -  could some one please help me


    Hasibur Rahman

    Saturday, September 12, 2015 12:16 AM

All replies

  • kindly make sure that 

    "actualend" attribute value is not NULL. Log the value of this field .

    if(entity_helpdesk.Attributes.Contains("actualend"))

    Thanks,



    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Thanks and Regards, Mohammad Yusuf Ansari http://microxrm.blogspot.in

    Sunday, September 13, 2015 9:19 AM