function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anthony Inniss 7Anthony Inniss 7 

How can i update a object in salesforce by useing AMPscript within the email. i want o mark Email Send Object status as complete once the email has been sent.

I need to send a notification to Salescloud that an email has been sent or has failed from 
 Marketing cloud on the Email send object.
 
I see the code that has bits and pieces of what I need but I'm not sure if I USE "
 
#Salesforce Developer
IF _messagecontext == 'Send' THEN
" to start the block.
%%[ var @Id, @firstName, @lastName, @email, @subscriberRows, @subscriberRow set @Id = _subscriberKey if RequestParameter("submitted") != true then set @subscriberRows = RetrieveSalesforceObjects( "Contact", "FirstName,LastName,Email", "Id", "=", @Id ) set @subscriberRow = Row(@subscriberRows, 1) set @firstName = Field(@subscriberRow, "FirstName") set @lastName = Field(@subscriberRow, "LastName") set @email = Field(@subscriberRow, "Email") else var @updateRecord set @firstname = RequestParameter("firstname") set @lastName = RequestParameter("lastname") set @email = RequestParameter("email") set @updateRecord = UpdateSingleSalesforceObject( "Contact", @Id, "FirstName", @firstname, "LastName", @lastName, "Email", @email ) endif ]%% <!DOCTYPE html> <html> <body> %%[ if @updateRecord == 1 then ]%% <p>Record Updated</p> %%[ elseif @updateRecord == 0 then ]%% <p>Update Failed</p> %%[ endif ]%% <h2>Update Your Details</h2> <form action="%%=RequestParameter('PAGEURL')=%%" method="post"> <label>First name</label> <input type="text" name="firstname" value="%%=v(@firstName)=%%"> <label>Last name</label> <input type="text" name="lastname" value="%%=v(@lastName)=%%"> <label>Email</label> <input type="text" name="email" value="%%=v(@email)=%%"> <input name="submitted" type="hidden" value="true" /> <input type="submit" value="Submit"> </form> </body> </html>
fdsvgf fvdvfdfdsvgf fvdvfd
I think you can face some serious issues while working on this process you need to visit here (https://nftfrog.com/) and use this software for better results.