0

I have AMPScript within an SMS message, and I'm trying to update an Account record in the connected GovCloud (Salesforce CRM). Here's my code:

UpdateSingleSalesforceObject('Account', AccountId, 'Appoinxxxxxxxxxxxxxxxxent_Date_Time__c', Now())

AccountId is part of the Journey Entry Data - and this comes through just fine. When I preview the SMS message, it renders the code and errors on this particular line.

enter image description here

Some things I've tried:

  1. I've output Now() to the message just so I can see how it outputs. Seems normal - just a normal date/time.
  2. This field in the CRM is in fact a date/time data type.
  3. I've tried messing around with Format(...) to no avail.

I've also attempted to run this journey, but as expected, I do not get the SMS message due to the error. The journey's "Event Results" shows my record entering and being accepted into the journey.

1

1 Answer 1

1

You simply need to convert to the correct format - SET @time = FormatDate(Now(), "iso")

Or you can do it straight away inside the update function - UpdateSingleSalesforceObject('Account', AccountId, 'Appoinxxxxxxxxxxxxxxxxent_Date_Time__c', FormatDate(Now(), "iso"))

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .