Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

plugin error finding in ErrorDetails file

(0) ShareShare
ReportReport
Posted on by 76

at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.CreateInternal(Entity entity, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Dictionary`2 optionalParameters)
at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.CreateOrganizationResponse(Entity entity)
at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.CreateEdmEntity(CrmODataExecutionContext context, String edmEntityName, EdmEntityObject entityObject, Boolean isUpsert)
at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySetImplementation(String& entitySetName, EdmEntityObject entityObject)
at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)
at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()
Activity Id: d1a0f62f-1283-487e-a20e-3060de8537b9

The Above one is ERRORDETAILS.txt file can any onne help me where can i see the issue in the above message

*This post is locked for comments

  • Suggested answer
    T.I.A Profile Picture
    1,760 on at
    RE: plugin error finding in ErrorDetails file

    Ok. so you need to get the description field in order to do this.  

    Entity account = service.Retrieve("account", account.id, new ColumnSet("description","fax"));

    if this retrieves successfully then you should be able to do what you need to 

    string accid = account.id;

    string fax = account.Attributes.Contains("fax") ? (string)account.Attributes["fax"] : null;

    if(fax  != null) {

     account.Attributes["description"] = $"Helloworld {accid } {fax}";

    }

  • Hemanth Reddy.B Profile Picture
    76 on at
    RE: plugin error finding in ErrorDetails file

    i just want to add account name and fax to descripption field i dont want to create account VIA plugiin i am doing it mannually

  • T.I.A Profile Picture
    1,760 on at
    RE: plugin error finding in ErrorDetails file

    you may want to use a pre image to bring back the values you want

  • T.I.A Profile Picture
    1,760 on at
    RE: plugin error finding in ErrorDetails file

    Entity account = new Entity("account");

    account.["description"] = $"Helloworld {accid } {fax}";

    account.["description"] = String.Format("Helloworld {0} {1}", accid, fax);

    service.Create(account);

    if you want to create an account do it like this

  • Hemanth Reddy.B Profile Picture
    76 on at
    RE: plugin error finding in ErrorDetails file

    namespace donno

    {

       public class Contactcreation : IPlugin

       {

           public void Execute(IServiceProvider serviceProvider)

           {

               ITracingService tracingService =

                   (ITracingService)serviceProvider.GetService(typeof(ITracingService));

               IPluginExecutionContext context = (IPluginExecutionContext)

                   serviceProvider.GetService(typeof(IPluginExecutionContext));

               IOrganizationServiceFactory serviceFactory =

                   (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));

               IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

               if (context.InputParameters.Contains("Target") &&

                   context.InputParameters["Target"] is Entity)

               {

                       Entity account = (Entity)context.InputParameters["Target"];

                   try

                   {

                       string accid = account.Attributes["accountid"].ToString();

                       string fax = account.Attributes["fax"].ToString();

                       account.Attributes["description"] = $"Helloworld {accid } {fax}";

                   }

                   catch (FaultException<OrganizationServiceFault> ex)

                   {

                       throw new InvalidPluginExecutionException("An error occurred in MyPlug-in.", ex);

                   }

                   catch (Exception ex)

                   {

                       tracingService.Trace("MyPlugin: {0}", ex.ToString());

                       throw;

                   }

    Any mistake in the code i did please let me know

  • Hemanth Reddy.B Profile Picture
    76 on at
    RE: plugin error finding in ErrorDetails file

    same issue T.I.A

  • T.I.A Profile Picture
    1,760 on at
    RE: plugin error finding in ErrorDetails file

    try account.Attributes["description"] = $"Helloworld {accid } {fax}";

    or account.Attributes["description"] = String.Format("Helloworld {0} {1}", accid, fax);

  • Hemanth Reddy.B Profile Picture
    76 on at
    RE: plugin error finding in ErrorDetails file

               if (context.InputParameters.Contains("Target") &&

                   context.InputParameters["Target"] is Entity)

               {

                       Entity account = (Entity)context.InputParameters["Target"];

                   try

                   {

                       string accid = account.Attributes["accountid"].ToString();

                       string fax = account.Attributes["fax"].ToString();

                       account.Attributes.Add("description", "Helloworld " + accid + fax);

                   }

    these the plugin i am using on preoperation getting above issue when i create account, can any one help me please. where did i go wrong

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans