• Mallik Vemugunta
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies
Hi I am trying to pass values from one page to another with wizard sample project, but I  am getting error because sprint.Project__c  is null, can some one look into this. I looked into the view state to confirm sprint.Project__c  is null. Also I would like to know how to use system.debug messages to navigate the program flow.
 
 
public class ProjectCreateExtension {

    private ApexPages.StandardController sc;
    public Project__c project {get; set;}
    public Sprint__c sprint {get; set;}
    public List<Sprint__c> sprints {get; set;}   
    public ProjectCreateExtension(ApexPages.StandardController controller) {
    
        sc =  controller;
        project = new Project__c();
        sprint = new Sprint__c();
        sprints = new List<Sprint__c>();        
    }
    
   
    public PageReference ToPage1() {
        return Page.ProjectCreate1;
    
    }
    
    public PageReference ToPage2() {
        if(ApexPages.CurrentPage().GetURL().StartsWith('/apex/CreateProject1')) {
            System.debug('before saveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee');            
            sc.save();            
        }
        return Page.ProjectCreate2;
    
    }
    
     
    public PageReference SaveSprint() {
        Project__c project = (Project__c)sc.GetRecord();
        sprint.Project__c = Project.Id;  
        insert sprint;   
        sprints.Add(sprint);
        sprint = new Sprint__c();
        return null;
    }
}
 
ProjectCreate1
 
<apex:page standardController="Project__c" title="Project Creation" extensions="ProjectCreateExtension">
    <apex:form >
        <apex:PageBlock title="Project Details">
        <apex:pageMessages />
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Continue" action="{!ToPage2}"/>
            <apex:commandButton value="save" action="{!save}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="Enter Project data">
            <apex:inputField value="{!Project__c.Name}"/>
            <apex:inputField value="{!Project__c.Start_Date__c}"/>
            <apex:inputField value="{!Project__c.Budget__c}"/>          
        </apex:pageBlockSection>       
        </apex:PageBlock>
    </apex:form>
</apex:page>
 
ProjectCreate2
 
<apex:page standardController="Project__c" title="Project Creation" extensions="ProjectCreateExtension">
    <apex:form >
        <apex:PageBlock title="Sprint Details">
         <apex:pageMessages />
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Project Details" action="{!ToPage1}"/>
            <apex:commandButton value="Save Sprint" action="{!SaveSprint}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="Enter Project data">
            <apex:inputField value="{!Sprint.Name}"/>
            <apex:inputField value="{!Sprint.Start_Date__c}"/>
            <apex:inputField value="{!Sprint.End_Date__c}"/>               
            <apex:outputText value="{!sprint.Project__c}"></apex:outputText>      
        </apex:pageBlockSection>    
        <apex:pageBlockTable value="{!sprints}" var="s">
            <apex:column value="{!s.name}"/>
            <apex:column value="{!s.Start_Date__c}"/>
            <apex:column value="{!s.End_Date__c}"/>
            <apex:column value="{!s.Project__c}"/>
               
        </apex:pageBlockTable>       
        </apex:PageBlock>
    </apex:form>
</apex:page>
I had the below code to display the selected contacts from the account page related list, looks like my !selected is not working, can someone help on this.
<apex:page StandardController="Contact" recordSetVar="contacts">
    <apex:form >
        <apex:pageblock >
            <apex:inputText value="{!Contact.AccountId}"/>
        </apex:pageblock>
        <apex:pageBlock >  
             <apex:pageBlockTable value="{!selected}" var="c">              
                <apex:column value="{!c.firstname}"/>
                <apex:column value="{!c.lastname}"/>     
                <apex:column value="{!c.Account.Name}"/>     
            </apex:pageBlockTable>           
        </apex:pageBlock>
    </apex:form>
</apex:page>
I am  getting Initial term of field expression must be a concrete SObject: LIST<Merchandise__c>error
for  the following code, please help

List<Account> accts = [SELECT Id, Name from Account]; ==> This is the line
System.debug(accts.size);
for(Account a : accts) {
System.debug('First Account Id: ' + a.Id);
System.debug('First Account Name: ' + a.Name); 
}
We are working with a client who has multiple opportunities available on several projects involving project management, implementation, and design and intergation.  Salesforce developers, adminstrators, and other certified Salesforce individuals are highly sought for these positions; both junior level and senior level openings.  If interested in learning more, please respond to this post with some form of contact information and we will reach out to you.  Thanks!! 
Hi I am trying to pass values from one page to another with wizard sample project, but I  am getting error because sprint.Project__c  is null, can some one look into this. I looked into the view state to confirm sprint.Project__c  is null. Also I would like to know how to use system.debug messages to navigate the program flow.
 
 
public class ProjectCreateExtension {

    private ApexPages.StandardController sc;
    public Project__c project {get; set;}
    public Sprint__c sprint {get; set;}
    public List<Sprint__c> sprints {get; set;}   
    public ProjectCreateExtension(ApexPages.StandardController controller) {
    
        sc =  controller;
        project = new Project__c();
        sprint = new Sprint__c();
        sprints = new List<Sprint__c>();        
    }
    
   
    public PageReference ToPage1() {
        return Page.ProjectCreate1;
    
    }
    
    public PageReference ToPage2() {
        if(ApexPages.CurrentPage().GetURL().StartsWith('/apex/CreateProject1')) {
            System.debug('before saveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee');            
            sc.save();            
        }
        return Page.ProjectCreate2;
    
    }
    
     
    public PageReference SaveSprint() {
        Project__c project = (Project__c)sc.GetRecord();
        sprint.Project__c = Project.Id;  
        insert sprint;   
        sprints.Add(sprint);
        sprint = new Sprint__c();
        return null;
    }
}
 
ProjectCreate1
 
<apex:page standardController="Project__c" title="Project Creation" extensions="ProjectCreateExtension">
    <apex:form >
        <apex:PageBlock title="Project Details">
        <apex:pageMessages />
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Continue" action="{!ToPage2}"/>
            <apex:commandButton value="save" action="{!save}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="Enter Project data">
            <apex:inputField value="{!Project__c.Name}"/>
            <apex:inputField value="{!Project__c.Start_Date__c}"/>
            <apex:inputField value="{!Project__c.Budget__c}"/>          
        </apex:pageBlockSection>       
        </apex:PageBlock>
    </apex:form>
</apex:page>
 
ProjectCreate2
 
<apex:page standardController="Project__c" title="Project Creation" extensions="ProjectCreateExtension">
    <apex:form >
        <apex:PageBlock title="Sprint Details">
         <apex:pageMessages />
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Project Details" action="{!ToPage1}"/>
            <apex:commandButton value="Save Sprint" action="{!SaveSprint}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="Enter Project data">
            <apex:inputField value="{!Sprint.Name}"/>
            <apex:inputField value="{!Sprint.Start_Date__c}"/>
            <apex:inputField value="{!Sprint.End_Date__c}"/>               
            <apex:outputText value="{!sprint.Project__c}"></apex:outputText>      
        </apex:pageBlockSection>    
        <apex:pageBlockTable value="{!sprints}" var="s">
            <apex:column value="{!s.name}"/>
            <apex:column value="{!s.Start_Date__c}"/>
            <apex:column value="{!s.End_Date__c}"/>
            <apex:column value="{!s.Project__c}"/>
               
        </apex:pageBlockTable>       
        </apex:PageBlock>
    </apex:form>
</apex:page>
I had the below code to display the selected contacts from the account page related list, looks like my !selected is not working, can someone help on this.
<apex:page StandardController="Contact" recordSetVar="contacts">
    <apex:form >
        <apex:pageblock >
            <apex:inputText value="{!Contact.AccountId}"/>
        </apex:pageblock>
        <apex:pageBlock >  
             <apex:pageBlockTable value="{!selected}" var="c">              
                <apex:column value="{!c.firstname}"/>
                <apex:column value="{!c.lastname}"/>     
                <apex:column value="{!c.Account.Name}"/>     
            </apex:pageBlockTable>           
        </apex:pageBlock>
    </apex:form>
</apex:page>
I am  getting Initial term of field expression must be a concrete SObject: LIST<Merchandise__c>error
for  the following code, please help

List<Account> accts = [SELECT Id, Name from Account]; ==> This is the line
System.debug(accts.size);
for(Account a : accts) {
System.debug('First Account Id: ' + a.Id);
System.debug('First Account Name: ' + a.Name); 
}