Last active
October 11, 2016 17:53
-
-
Save zachboyd/eb8c6aee3e0a289fe5551a56d280e6d6 to your computer and use it in GitHub Desktop.
Salesforce Marketing Cloud - Update Contact with AMP example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
%%[ | |
var @Id, @contactRecord, @limitRow, @firstName, @lastName | |
set @Id = RequestParameter('id') | |
set @firstName = RequestParameter('firstName') | |
if RequestParameter("submitted") == "submitted" then | |
var @result | |
set @result = UpdateSingleSalesforceObject("Contact", @Id, "FirstName", @firstName) | |
endif | |
set @contactRecord = RetrieveSalesforceObjects('Contact','FirstName, LastName','Id','=', @Id) | |
set @limitRow = Row(@contactRecord, 1) | |
set @firstName = Field(@limitRow,'FirstName') | |
set @lastName = Field(@limitRow,'LastName') | |
]%% | |
<form action="%%=RequestParameter('PAGEURL')=%%" method="post"> | |
<input id="submitted" type="hidden" name="submitted" value="submitted" /> | |
<input type="text" name="firstName" value="%%=v(@firstName)=%%" /> | |
<input type="text" name="lastName" value="%%=v(@lastName)=%%" /> | |
<input type="submit" value="Submit"> | |
</form> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment