• Shubham Kashyap 27
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am getting this error "Unknown property 'name' referenced in PageReference_Example_VF".

Can someone fix this, please?
Controller:
public class PageReference_Example {   
    public String selected {set;get;}
    public String name {set;get;}
    public PageReference callMe(){
        if(selected=='Housing'){
            PageReference p = new PageReference('/apex/HousingLoanPage');
            return p;
        }
        else{
            if(selected=='Personal'){
            PageReference p = new PageReference('/apex/PersonalLoanPage');
            return p;
        	}
        	else 
            	return null;
        }
    }
}
VF page
<apex:page controller="PageReference_Example">
    <apex:form>
    	<apex:page >
            <apex:pageBlock title="Home Page">
        		<apex:pageBlockSection >
            		<apex:pageBlockSectionItem>
                    	<apex:outputLabel value="Name"/>
                    	<apex:inputText value="{!name}"/>
                	</apex:pageBlockSectionItem>
            	</apex:pageBlockSection>
        	</apex:pageBlock>
        </apex:page>
    </apex:form>
</apex:page>
I am getting this error "Unknown property 'name' referenced in PageReference_Example_VF".

Can someone fix this, please?
Controller:
public class PageReference_Example {   
    public String selected {set;get;}
    public String name {set;get;}
    public PageReference callMe(){
        if(selected=='Housing'){
            PageReference p = new PageReference('/apex/HousingLoanPage');
            return p;
        }
        else{
            if(selected=='Personal'){
            PageReference p = new PageReference('/apex/PersonalLoanPage');
            return p;
        	}
        	else 
            	return null;
        }
    }
}
VF page
<apex:page controller="PageReference_Example">
    <apex:form>
    	<apex:page >
            <apex:pageBlock title="Home Page">
        		<apex:pageBlockSection >
            		<apex:pageBlockSectionItem>
                    	<apex:outputLabel value="Name"/>
                    	<apex:inputText value="{!name}"/>
                	</apex:pageBlockSectionItem>
            	</apex:pageBlockSection>
        	</apex:pageBlock>
        </apex:page>
    </apex:form>
</apex:page>
Hello Community,

I'm having an issue with this particular challenge below: 

Write an Apex trigger that fires before records are inserted and ensures that the ShippingState field has the same value as the BillingState field.
Create an Apex class named AccountTriggerHandler that contains a public static method called CreateAccounts to accept the List of Account objects.
For each Account record, before saving, ensure that the ShippingState field has the same value as the BillingState field.
Write an Apex trigger named AccountTrigger that fires before records are inserted.
The Apex trigger must call the AccountTriggerHandler.CreateAccounts() method with the collection of new records.
Create a test class named AccountTriggerTest that inserts 200 Account records with a BillingState of CA. After the insert, test to ensure that all 200 records have a ShippingState of CA.
Before verifying this challenge, run your test class at least once using the Developer Console Run All feature.

This is my Challenge Error:

Challenge Not yet complete... here's what's wrong: 
The Trigger 'AccountTrigger' does not appear to be calling the AccountTriggerHandler class correctly or using isBefore or isInsert content variables.

These are my codings below :
AccountTriggerHandler
User-added image

AccountTrigger - Trigger On Account Object
User-added image

AccountTriggerTest
User-added image

P.S. I'm pretty new to the developing with Apex so I'm learning and growing so the help is appreciated community.