ICommitLeadToSFCommandHandler.Handle

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

var commitLeadToSFCommandHandler = Activate<ICommitLeadToSFCommandHandler>();
await commitLeadToSFCommandHandler.Handle(
    FromJson<CommitLeadToSFRequest>("{\"RavingFanId\":43256,\"LastName\":\"LastName\",\"FirstName\":\"FirstName\",\"Title\":null,\"Company\":\"510 Architects\",\"Street\":\"3330 W Leigh St\",\"City\":\"Richmond\",\"State\":\"VA\",\"PostalCode\":\"23230\",\"Country\":\"United States\",\"Phone\":null,\"Email\":\"hgrutizius@510architects.com\",\"Website\":null,\"LeadSource\":\"Employee Referral\",\"Fiscal_Year_End__c\":null,\"Entity_Type__c\":null,\"Source_Email__c\":\"Ryan.Mabee@alliantgroup.com\",\"Source_Name__c\":\"Ryan Mabee\",\"CPA_Email__c\":\"bryanp@advancetecllc.com\",\"CPA_Firm__c\":\"Meadows Urquhart Acree & Cook LLP\",\"CPA_Name__c\":\"Bryan Phelan\",\"CPA_Phone__c\":\"804-378-1550\",\"Service_Lines_Interested_In__c\":\"179D Services\",\"Existing_Client_Project_Manager__c\":\"Ryan Mabee\",\"Primary_Service_Line__c\":\"179D Services\",\"ASL__c\":true,\"Mattersphere_Referral_ID__c\":\"43256\",\"Matter_Number__c\":null,\"PM_ID__c\":\"5967\",\"CR_ID__c\":null,\"Submitted_By_ID__c\":5967,\"Submitted_By_Title__c\":null,\"Sub_Team_ID__c\":null,\"Team_ID__c\":null,\"CPA_Contact_Title__c\":null,\"Additional_Notes__c\":\"Heather Grutzius <hgrutzius@510architects.com> is the POC here. Founding Principle. \n(o) 804.353.1576  (m) 703.963.7076\n\nI connected with Neha Shrestha already regarding this and have reached out to set up call.\",\"Referring_Client_Consent__c\":\"Yes\",\"Existing_Client_Project_Number__c\":\"317255.0004\",\"Referred_By_Company__c\":\"510 Architects\",\"Referred_By_Contact__c\":\"FirstName LastName\",\"Referred_By_Title__c\":null,\"Referred_By_Contact_Phone__c\":null,\"Referred_By_Contact_Email__c\":\"hgrutizius@510architects.com\",\"Current_Service_Lines__c\":\"R&D\",\"Existing_Client_Team_Director__c\":\"Austin Carswell\"}"),
    null,
    null);

Parameters

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

State

3/26/2024 8:02:22 PM (+1.503s) 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 295
   at AG.A1.Scheduler.Project.Application.Helpers.SalesforceHelper.CreateLead(Lead lead, Boolean bypassTokenValidation) in C:\agent\_work\1\s\A1Solution\src-schedulers\AG.A1.Scheduler.Project.Application\Helpers\SalesforceHelper.cs:line 125
   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 67
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

+93ms Processing

Server:
wn0mdwk0001s9:5432
Worker:
56b78905

+40ms Enqueued

3/26/2024 8:02:21 PM Created