locked
How to implement error logging in mscrm 2015 online? RRS feed

  • Question

  • Could you please provide the error logging approach that we can implement in mscrm 2015 online.



    hari ________________________________________________________ If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Wednesday, May 6, 2015 11:33 AM

All replies

  • Hello,

    I would personally use a custom entity that logs expected errors/messages from your plugsins, js resources etc.


    Cornel Croitoriu - Senior Software Developer

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Biz-Forward.comCroitoriu.NET

    Thursday, May 7, 2015 6:49 AM
  • thanks for the update.

    When exception occurs in plugin, how you will initiate organization proxy to create error record in crm?

    we are unable to create org service proxy in isolation( sandbox) mode of the plugins. getting error(

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): OKNGMS.Crm.Plugins.FundingCallPlugin: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Detail:

    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">

      <ErrorCode>-2147220956</ErrorCode>

      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />

      <Message>Unexpected exception from plug-in (Execute): OKNGMS.Crm.Plugins.FundingCallPlugin: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</Message>

      <Timestamp>2015-05-02T11:20:15.8165743Z</Timestamp>

      <InnerFault i:nil="true" />

      <TraceText>

    )

    If possible could you please share some sample  utility code to generate proxy .


    hari ________________________________________________________ If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Thursday, May 7, 2015 10:22 AM
  • You can't create an instance of the OrganizationServiceProxy within the sandbox, as the sandbox does not allow you to specify credentials. Instead you should get the IOrganizationService instance from the plugin execution context - see the first 2 blocks of code in https://msdn.microsoft.com/en-us/library/gg309673.aspx

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Thursday, May 7, 2015 11:34 AM
    Moderator