0

enter image description hereI would like to update a custom salesforce object when a marketing cloud email is sent. I have a transaction object and once the email is sent, I would like to update the description field to “Acknowledged”.

To use ampscript code UpdateSingleSalesforceObject I need the transaction Id in my data extension however I already have the contact ID (for email sending) in my data extension so I’m stuck on how to pull in a second ID in the query.

Is there a way to rename the transaction Id before pulling it into my data extensions?

I was also wondering do I need to create 2 separate data extensions in Contact builder? I have never used Contact builder so I’m not sure how I would link the data extensions together.

Will this even work putting the below code at the beginning of an email? %%[ var @result set @result = UpdateSingleSalesforceObject(‘AQB__Transaction__c’,’TransId’,’AQB__Description__c’,’Acknowledged’) ]%%

Appreciate any guidance, I'm getting above my skill set but I really want this to work.

0

If you have a lookup between these two objects Contacts and Transaction. You can create the sendable data extension using query activity and pull the transaction ids along with the contact ids in a separate column. Once you have the transaction ids in your sendable data extension, you can perform the above UpdateSingleSalesforceObject in your email.

  • thank you so much for your assistance. I do have a lookup and when i try to pull the transaction Id in, it tells me I have already pulled in an Id column. I have a screenshot of the error and will try to figure out where to upload it so you can see it. – LB47606 Sep 11 '18 at 14:57
  • code works fine until I add line #4. – LB47606 Sep 11 '18 at 14:59
  • Thank you so much you got me pushed in the right direction. I found that i could rename the ID field by using AS after it. This worked. Select ATransCont.AQB__Amount__c, ATransCont.AQB__Date__c, ATransCont.Designation_Name__c, ATransCont.Id as TransId, AContacts.FirstName, AContacts.Email, AContacts.Id, Accounts.DRM_Email__c From ATransCont Inner Join AContacts on ATransCont.AQB__Account__c=AContacts.AccountId Inner Join Accounts on AContacts.AccountId = Accounts.Id – LB47606 Sep 11 '18 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.