[SalesForce] UpdateSingleSalesforceObject – Error in the application

I am trying to save the send date in a Sales Cloud field with this expression:

%%[SET @Lead_Id="00Q3100000Z3HIcAAN", SET @result = UpdateSingleSalesforceObject('Lead',@Lead_Id,'Reminder_Email1_Sent__c',Now())]%%

This results in an error.

Call to update the salesforceobject Lead ID = 00Q3100000Z3HIcAAN failed! Error in the application.

Has anybody an idea why?

The field 'Reminder_Email1_Sent__c' is a date field on a Lead Object.

Best Answer

This could be due to different reasons, but guess would be that the date time format generated by the Now() function is not in the same syntax that is required by the date field in Sales Cloud.

I would try formatting the date as follows:

var @Lead_Id, @result, @dateTime

set @dateTime = Replace(FormatDate(Now(),"yyyy-MM-ddT","hh:mm:ss"),' ','')
set @Lead_Id = "00Q3100000Z3HIcAAN"
set @result = UpdateSingleSalesforceObject('Lead',@Lead_Id,'Reminder_Email1_Sent__c',@dateTime)
Related Topic