0

I have created an ExactTarget Landing Page form which does two things upon submission.

  1. Create a Lead
  2. Create a Campaign Response - *this part works with no issues

The relevant AMPScript is below.

What is happening is this - if I remove the two 'Opt-Out' fields(3rd and 4th from the bottom) from the Object creation, the 'Description' and 'Lead Source' fields right below it populate SFDC with no issues.

However, if I put the Opt-Out fields back in, both the 'Description' and 'Lead Source' fields don't populate in SFDC, even though I can see them in the posted form values.

Is there anything that looks incorrect? If I had any hair I'd be pulling it out.


** Below will set the 'OPT-OUT' values but NOT pass the 'Description' and 'LeadSource'

SET @_SFobjid = CreateSalesforceObject
("Lead",13,"Company",RequestParameter("Company"),
"StateCode",RequestParameter("StateCode"),
"PostalCode",RequestParameter("PostalCode"),
"HasOptedOutOfEmail",IsNullDefault(RequestParameter("HasOptedOutOfEmail"),"False"),
"Mail_Opt_Out__c",IsNullDefault(RequestParameter("Mail_Opt_Out__c"),"False"),
"Description",@Description,
"LeadSource",RequestParameter("LeadSource"))

** Below will pass the 'Description' and 'LeadSource' with the Opt-Out fields not included

SET @_SFobjid = CreateSalesforceObject
("Lead",13,"Company",RequestParameter("Company"),
"StateCode",RequestParameter("StateCode"),
"PostalCode",RequestParameter("PostalCode"),
"Description",@Description,
"LeadSource",RequestParameter("LeadSource"))
2
  • I've noticed the occasional quirk in AMPscript when using nested function calls. Could you tell us what happens if you pull out all the function calls from the CreateSalesforceObject and put them in variables?
    – Timothy
    May 7, 2014 at 19:35
  • Thank you Timothy! Your suggestion lead me down the correct path. Once I pulled out the nested functions I noticed my other issue - I wasn't accounting for a hidden variable, which meant the number of fields specified in 'CreateSalesForceObject' was short by one. Really stupid mistake, but stepping back allowed me to find it. Also, thank you to Kelly for all the help you provide here as well.
    – Brian M
    May 8, 2014 at 19:01

0

You must log in to answer this question.

Browse other questions tagged .