Plugins CRM 2011 in offline mode don't work

Unanswered Plugins CRM 2011 in offline mode don't work

  • Friday, February 17, 2012 3:52 PM
     
     

    Hello

    Configuration : Server 2011 rollup 5

    Client outlook rollup 5 (test rollup 6)

    this is a part of myplugins

    Post account

    Entity EltClient = new Entity();

    EltClient.LogicalName = "ff_elementtarifaireclient";

    EltClient["ff_clientid"]=new EntityReference("account", idCpt);

    EltClient["ownerid"]=new EntityReference("systemuser", idUser);

     

    if (context.IsExecutingOffline)//Si le plgin s'exécute en mode offline
       {
       //On génère le Guid du record manuellement
       //Key key = new Key();
       //key.Value = Guid.NewGuid();
       Guid elementtarifaire=Guid.NewGuid();
       //throw new Exception("ici guid " + elementtarifaire.ToString());
       EltClient["ff_elementtarifaireclientid"] = elementtarifaire;
       //throw new Exception("ici apres " );
       }

    iService.Create(EltClient);   // the error is here

    ....

    This plugins createcomptetarif work perfectly in online mode with Outlook but in offline mode

    i received this errors

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Erreur Plugins CreateCompteTarif 2Detail:
    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
      <ErrorCode>-2147220891</ErrorCode>
      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
        <KeyValuePairOfstringanyType>
          <d2p1:key>OperationStatus</d2p1:key>
          <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">0</d2p1:value>
        </KeyValuePairOfstringanyType>
      </ErrorDetails>
      <Message>Erreur Plugins CreateCompteTarif 2</Message>
      <Timestamp>2012-02-17T15:34:46.3588365Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText>

    [CreateCompteTarif]
    [9724ab17-3853-e111-bb7b-0050569d7c92: CreateCompteTarif: Create of account]
    CREATE COMPTE tarif 2: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault] : An unexpected error occurred. (le détail de l'erreur est égal à Microsoft.Xrm.Sdk.OrganizationServiceFault).

    </TraceText>
    </OrganizationServiceFault>

    thank for you help

All Replies

  • Monday, April 30, 2012 10:30 PM
     
     

    You can debug offline plugins by attaching your debugger to Microsoft.Crm.Application.Hoster.exe

    Please refer to this documentation on how to debug plugins including offline:

    http://msdn.microsoft.com/en-us/library/gg328574.aspx

    Thanks,

    Uma Maheswari Anbazhagan [MSFT]

  • Monday, April 30, 2012 11:20 PM
     
     

    hi Uma,

     if your plugin works online and having issue going offline ,

     this might be because of some configurational setting .

     Can you check for any of this

     1) a Offline plugin can only run in Synchronous mode , make sure its not running in Asynchronously

     2) Add a Registry Sub-key to the AllowList

       An additional security restriction for an offline plug-in requires that a registry key named after the public key token of the plug-in assembly must be added to the system registry.

    Have a look at this article

    http://technet.microsoft.com/en-us/library/bb955364.aspx

    hth

    dkay

    if the response answered your question, please take a minute and mark the response as an answer.

  • Tuesday, May 01, 2012 8:49 PM
     
     

    Hi
     
    Did this help?

    Please make sure to mark as answer to the response that helped you get through. This will help others with similar problem identify the answer and also close this thread as resolved.
     
    Thanks
     
    Dkay