ICommitLeadToSFCommandHandler.Handle

// Job ID: #44745
using AG.A1.Scheduler.Project.Contracts.Contracts;

var commitLeadToSFCommandHandler = Activate<ICommitLeadToSFCommandHandler>();
await commitLeadToSFCommandHandler.Handle(
    FromJson<CommitLeadToSFRequest>("{\"RavingFanId\":41456,\"LastName\":\"\",\"FirstName\":\"Chris\",\"Title\":\"Owner\",\"Company\":\"Chris\",\"Street\":\"3291 N Bend Rd\",\"City\":\"Cincinnati\",\"State\":\"OH\",\"PostalCode\":\"45239\",\"Country\":\"United States\",\"Phone\":\"8122078020\",\"Email\":\"bdincy@bdpest.com\",\"Website\":\"https://www.blackdiamondpestcontrol.com/locations/cincinnati-oh\",\"LeadSource\":\"Employee Referral\",\"Fiscal_Year_End__c\":null,\"Entity_Type__c\":\"LLC\",\"Source_Email__c\":\"Mikel.Gonzalez-Arellano@alliantgroup.com\",\"Source_Name__c\":\"Mikel Gonzalez-Arellano\",\"CPA_Email__c\":\"\",\"CPA_Firm__c\":\"Atlas Cpas & Advisors PLLC\",\"CPA_Name__c\":\"\",\"CPA_Phone__c\":\"\",\"Service_Lines_Interested_In__c\":null,\"Existing_Client_Project_Manager__c\":\"Mikel Gonzalez-Arellano\",\"Primary_Service_Line__c\":\"ERC Services\",\"ASL__c\":false,\"Mattersphere_Referral_ID__c\":\"41456\",\"Matter_Number__c\":null,\"PM_ID__c\":\"4785\",\"CR_ID__c\":null,\"Submitted_By_ID__c\":4785,\"Submitted_By_Title__c\":null,\"Sub_Team_ID__c\":null,\"Team_ID__c\":null,\"CPA_Contact_Title__c\":\"\",\"Additional_Notes__c\":\"Referred by Dan Deimling from D2CG - this was a Whitney Brady op working with her to get Chris signed up\",\"Referring_Client_Consent__c\":\"Yes\",\"Existing_Client_Project_Number__c\":\"326821.0001\",\"Referred_By_Company__c\":\"D2 CG LLC Dba D2consulting Group LLC\",\"Referred_By_Contact__c\":null,\"Referred_By_Title__c\":null,\"Referred_By_Contact_Phone__c\":null,\"Referred_By_Contact_Email__c\":null,\"Current_Service_Lines__c\":\"ERC\",\"Existing_Client_Team_Director__c\":\"Reid McLaughlin\"}"),
    null,
    null);

Parameters

CurrentCulture
"en-US"
CurrentUICulture
"en-US"

State

8/9/2023 9:26:45 PM (+1.170s) Failed

An exception occurred during performance of the job.

Newtonsoft.Json.JsonSerializationException

Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'AG.Integrations.RESTClients.SalesforceREST.Models.Lead' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly. To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array. Path '', line 1, position 1.

Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'AG.Integrations.RESTClients.SalesforceREST.Models.Lead' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path '', line 1, position 1.
   at AG.A1.Framework.Rest.RESTClient.HandleResponse[T](RestResponse restResponse) in C:\agent\_work\1\s\A1Solution\src-framework\AG.A1.Framework\Rest\RESTClient.cs:line 354
   at AG.A1.Framework.Rest.RESTClient.ExecutePOSTAsync[T](IRESTEndpoint apiEndpoint, IDictionary`2 headers, IDictionary`2 bodyParameters, IDictionary`2 urlParameters) in C:\agent\_work\1\s\A1Solution\src-framework\AG.A1.Framework\Rest\RESTClient.cs:line 251
   at AG.Integrations.RESTClients.SalesforceREST.SalesforceApiClientController.CreateLead(IDictionary`2 param, SalesforceToken token) in C:\agent\_work\1\s\A1Solution\src-integrations\AG.Integrations.RESTClients\SalesforceREST\SalesforceApiClientController.cs:line 298
   at AG.A1.Scheduler.Project.Application.Helpers.SalesforceHelper.CreateLead(Lead lead) in C:\agent\_work\1\s\A1Solution\src-schedulers\AG.A1.Scheduler.Project.Application\Helpers\SalesforceHelper.cs:line 132
   at AG.A1.Scheduler.Project.Application.Features.RavingFanReferralToSF.Commands.CommitLeadToSFCommandHandler.Handle(CommitLeadToSFRequest request, CancellationToken cancellationToken, PerformContext performContext) in C:\agent\_work\1\s\A1Solution\src-schedulers\AG.A1.Scheduler.Project.Application\Features\LeadToSF\Commands\CommitLeadToSFCommandHandler.cs:line 69
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

+20ms Processing

Server:
wn0mdwk0000q8:7180
Worker:
f78f99e1

+73ms Enqueued

8/9/2023 9:26:44 PM Created