ICommitLeadToSFCommandHandler.Handle

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

var commitLeadToSFCommandHandler = Activate<ICommitLeadToSFCommandHandler>();
await commitLeadToSFCommandHandler.Handle(
    FromJson<CommitLeadToSFRequest>("{\"RavingFanId\":43150,\"LastName\":\"Thompson\",\"FirstName\":\"Frank\",\"Title\":\"Owner\",\"Company\":\"Thompson Luke and Associates LLC\",\"Street\":\"10705 Rieger Road \",\"City\":\"Baton Rouge\",\"State\":\"LA\",\"PostalCode\":\"70809\",\"Country\":\"United States\",\"Phone\":\"2252939474\",\"Email\":\"frank@TLAeng.com\",\"Website\":\"https://www.tlaeng.com/\",\"LeadSource\":\"Employee Referral\",\"Fiscal_Year_End__c\":null,\"Entity_Type__c\":null,\"Source_Email__c\":\"Carlos.Moron@alliantgroup.com\",\"Source_Name__c\":\"Carlos Moron Garcia\",\"CPA_Email__c\":\"\",\"CPA_Firm__c\":\"\",\"CPA_Name__c\":\"\",\"CPA_Phone__c\":\"\",\"Service_Lines_Interested_In__c\":null,\"Existing_Client_Project_Manager__c\":\"Tyler Sandum\",\"Primary_Service_Line__c\":\"R&D Services\",\"ASL__c\":false,\"Mattersphere_Referral_ID__c\":\"43150\",\"Matter_Number__c\":null,\"PM_ID__c\":\"6971\",\"CR_ID__c\":null,\"Submitted_By_ID__c\":999,\"Submitted_By_Title__c\":null,\"Sub_Team_ID__c\":null,\"Team_ID__c\":null,\"CPA_Contact_Title__c\":\"\",\"Additional_Notes__c\":\"Phone number is the office number. he wants to be emailed instead.\nThey do MEP engineering services with professional engineers on staff\",\"Referring_Client_Consent__c\":\"No\",\"Existing_Client_Project_Number__c\":\"315241.0008\",\"Referred_By_Company__c\":\"Thompson Building Energy Solutions\",\"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\":\"R&D\",\"Existing_Client_Team_Director__c\":\"Taylor Broussard\"}"),
    null,
    null);

Parameters

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

State

3/8/2024 5:32:10 PM (+986ms) 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 38
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

+54ms Processing

Server:
wn1mdwk0000fw:10680
Worker:
88ba3e20

+36ms Enqueued

3/8/2024 5:32:08 PM Created