• RP2
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

This works fine...

 

    public void searchAndCreateContact(){
        
        String payerEmail = '';
        if(username != ''){
            payerEmail = username;
            List<User>lstPayerContact = [select ContactId, name, AccountId FROM User where Username = :username];
        }else{
            payerEmail = mapParameters.get('payer_email');
            List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];
            }
        List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];
        // why can the above line not be nested in the else statement above.
        // Error: Compile Error: Variable does not exist: lstPayerContact at line 231 column 20
        if(lstPayerContact  != null && lstPayerContact.size()>0){
            cont = lstPayerContact[0];
            List<Account>lstAccount = [select id,name from Account where id=:cont.AccountId];
            if(lstAccount != null && lstAccount.size()>0)
                accnt = lstAccount[0];
            
        }else{

 

Why can does this not compile?

 

    public void searchAndCreateContact(){
        
        String payerEmail = '';
        if(username != ''){
            payerEmail = username;
            List<User>lstPayerContact = [select ContactId, name, AccountId FROM User where Username = :username];
        }else{
            payerEmail = mapParameters.get('payer_email');
            List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];
            }

        if(lstPayerContact  != null && lstPayerContact.size()>0){
            cont = lstPayerContact[0];
            List<Account>lstAccount = [select id,name from Account where id=:cont.AccountId];
            if(lstAccount != null && lstAccount.size()>0)
                accnt = lstAccount[0];
            
        }else{

 

Thanks

 

    public void searchAndCreateContact(){                String payerEmail = '';        if(username != ''){            payerEmail = username;            List<User>lstPayerContact = [select ContactId, name, AccountId FROM User where Username = :username];        }else{            payerEmail = mapParameters.get('payer_email');            List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];            }        List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];        // why can the above line not be nested in the else statement above.        // Error: Compile Error: Variable does not exist: lstPayerContact at line 231 column 20        if(lstPayerContact  != null && lstPayerContact.size()>0){            cont = lstPayerContact[0];            List<Account>lstAccount = [select id,name from Account where id=:cont.AccountId];            if(lstAccount != null && lstAccount.size()>0)                accnt = lstAccount[0];                    }else{

  • July 29, 2013
  • Like
  • 0

How can a varible be prepopulate on a visual force form?

 

<apex:pageBlockSectionItem >
          <apex:outputLabel value="First Name"></apex:outputLabel>
               <apex:inputText value="{!firstname}"/>
          </apex:pageBlockSectionItem>
 <apex:pageBlockSectionItem >

 

How can the variable {!firstname} in the above example be prepopulated?

 

Something like..

 

<apex:param name="firstname" value="{!Opportunity.Account.Contact.Fristname" />

 

  • December 01, 2012
  • Like
  • 0

This works fine...

 

    public void searchAndCreateContact(){
        
        String payerEmail = '';
        if(username != ''){
            payerEmail = username;
            List<User>lstPayerContact = [select ContactId, name, AccountId FROM User where Username = :username];
        }else{
            payerEmail = mapParameters.get('payer_email');
            List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];
            }
        List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];
        // why can the above line not be nested in the else statement above.
        // Error: Compile Error: Variable does not exist: lstPayerContact at line 231 column 20
        if(lstPayerContact  != null && lstPayerContact.size()>0){
            cont = lstPayerContact[0];
            List<Account>lstAccount = [select id,name from Account where id=:cont.AccountId];
            if(lstAccount != null && lstAccount.size()>0)
                accnt = lstAccount[0];
            
        }else{

 

Why can does this not compile?

 

    public void searchAndCreateContact(){
        
        String payerEmail = '';
        if(username != ''){
            payerEmail = username;
            List<User>lstPayerContact = [select ContactId, name, AccountId FROM User where Username = :username];
        }else{
            payerEmail = mapParameters.get('payer_email');
            List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];
            }

        if(lstPayerContact  != null && lstPayerContact.size()>0){
            cont = lstPayerContact[0];
            List<Account>lstAccount = [select id,name from Account where id=:cont.AccountId];
            if(lstAccount != null && lstAccount.size()>0)
                accnt = lstAccount[0];
            
        }else{

 

Thanks

 

    public void searchAndCreateContact(){                String payerEmail = '';        if(username != ''){            payerEmail = username;            List<User>lstPayerContact = [select ContactId, name, AccountId FROM User where Username = :username];        }else{            payerEmail = mapParameters.get('payer_email');            List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];            }        List<Contact>lstPayerContact = [select id,name,AccountId from Contact where Email = :payerEmail ];        // why can the above line not be nested in the else statement above.        // Error: Compile Error: Variable does not exist: lstPayerContact at line 231 column 20        if(lstPayerContact  != null && lstPayerContact.size()>0){            cont = lstPayerContact[0];            List<Account>lstAccount = [select id,name from Account where id=:cont.AccountId];            if(lstAccount != null && lstAccount.size()>0)                accnt = lstAccount[0];                    }else{

  • July 29, 2013
  • Like
  • 0

Hello

 

We currently run our partner portal with Wordpress. Partners do not have any visibility to SF data or the opportunity progression.

Is it possible to grab data from Salesforce and display in Wordpress? meaning that every partner will login to wordpress (with his unique login), click on a tab "Opportunities" and will see only his opportunities (stage, amount, comments, other custom fields...).

 

 

Thanks!

 

Itay