0

I have two links out of which one has account Id of salesforce and one has Sent email id of salesforce. Now the requirement goes like based on the the Ids i should be able to capture the Email address to whom the email is sent and prepopulate it in the email address field and the based on the same accpunt Id i should be able to make the update back to a salesforce object.For the above situation i have written a code:-

%%[set @lookupValue=RequestParameter('EmailId')/*captures the sent email Id*/
set @lookupValue1=RequestParameter('a')/*captures the account id parameter*/
set @submit=RequestParameter('submit')/*captures the submit parameter*/
if( @lookupValue1 == '') then  /*checking for if the account Id parameter is empty*/
set @Email=Lookup("Sent_Email_vod__c_Salesforce","Account_Email_vod__c","Id",@lookupValue)
/*it will check in the sent email custom object and fetch the  Email address based on the sent email id
Endif

set @Email = Lookup("Account_Salesforce","PersonEmail","Id", @lookupValue)
/*if there is no conditionthe default condition is taking up the email adress based on the account id

set @checkbox1=RequestParameter('subscribechck')

if @submit=='submited' and @checkbox1=='True' then


   
]%%


<p>
 the outputis
</p>



%%[Else then]%%
<form action="/dgoguzeq3de" method="post">
<label for="email" class="lbl">Email address*</label><br>

  <input type="email" name="email" value="%%=v(@Email)=%%">
        

  <br>
  
<input id="subscribe" name="subscribechck" type="checkbox" value="True">Aunbrig marketing email<br>
  <input id="subscribe" name="seccheck" type="checkbox" value="Truechck">Receiving emails from my Representative for Alunbrig<br>
  <input type="hidden" name="EmailId" value="%%=v(@lookupValue)=%%">
   <input type="hidden" name="a" value="%%=v(@lookupValue1)=%%">
<input type="submit" name="submit" value="submited"> 
</form>



%%[Endif]%%
  • you have some errors in your code, is the page even loading? – garek007 Jun 17 at 16:54

Your Answer

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

Browse other questions tagged or ask your own question.