• Luke Greenstreet
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Salesforce Administrator
  • The Training Room

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
Hi,

I am new to visualforce and using a address QAS tool, to get this to function as we want I have had to put it on a VF page.

The VF page is accessed via the Person Account object when the related list NEW OVERRIDE button is pressed. The page works as intended but I dont know how to store the ID of the Person Account record that I came from. Do I need to use a custom controller? I have done some reading on apex:param and URL param but I am struggling to get my head around them. Any help would be much appreciated. Thanks

VF Page:
<apex:page standardController="Previous_Address__c" showHeader="true" recordSetVar="PreviousAdresses">
    
    <apex:form >      
            <apex:pageBlock mode="edit" title="Previous Address">
                    <apex:pageBlockButtons >
                        <apex:commandButton value="Save" action="{!Save}"/>
                        <apex:commandButton value="Cancel" action="{!Cancel}"/>
                    </apex:pageBlockButtons>
                <apex:pageBlockSection title="Previous Address" collapsible="false"  columns="1" >
                    <apex:outputField label="Contact" value="{!Previous_Address__c.Contact__c}"/> 
                    <apex:inputField Label="Address Resident From" value="{!Previous_Address__c.Address_Resident_From_Date__c}"/>
                    <apex:inputField Label="Address Resident To" value="{!Previous_Address__c.Address_Resident_To_Date__c}"/>                       
                    <apex:inputField Label="House Number" value="{!Previous_Address__c.House_Flat_No__c}"/>
                    <apex:inputField Label="House Name" value="{!Previous_Address__c.House_Name__c}"/>
                    <apex:inputField Label="Flat Number" value="{!Previous_Address__c.Flat_Number__c}"/>
                    <pca:Address Street="{!Previous_Address__c.Street__c}" State="{!Previous_Address__c.County__c}" City="{!Previous_Address__c.City__c}" Zip="{!Previous_Address__c.Postcode__c}" Country="{!Previous_Address__c.Country__c}"  > </pca:Address>            
                </apex:pageBlockSection>                     
             </apex:pageBlock> 
        </apex:form>        
</apex:page>

 
Hi New to the community,

Completing my Lightning Experience Reports & Dashboards Specialist superbadge today and recieved this error:

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: KYVMOIPO

I was using a new trailhead playground as stated in the pre course.

Can anyone help?

Thanks
Hi,

I was recently asked to create three large formula fields in a custom object we call Loan App.

They would calculate a high value, medium value and low value based on several different variables and would only one of the fields would be populated at any given time.  All the formulas work fine but i have now been asked if i can get the value returned to show in a separate field for reporting. The combined character value is about 9k so there is no way i am able to use a formula field to return a value. 

I have read that triggers can be used to update fields but have only found examples where they are reading one value from another field and not multiples.

If i was going to write it in a formula i would do this:
IF(AND(Payment_Terms__c >=1,Loancalclow__C<> null) , loancalclow__C,
IF(AND(Payment_Terms__c >=1,Loancalclmed__C<> null) , loancalcmed__C,
IF(AND(Payment_Terms__c >=1,Loancalclhigh__C<> null) , loancalchigh__C,
0),0),0)

Can anyone help?

Thanks in advance
Hi,

I am new to visualforce and using a address QAS tool, to get this to function as we want I have had to put it on a VF page.

The VF page is accessed via the Person Account object when the related list NEW OVERRIDE button is pressed. The page works as intended but I dont know how to store the ID of the Person Account record that I came from. Do I need to use a custom controller? I have done some reading on apex:param and URL param but I am struggling to get my head around them. Any help would be much appreciated. Thanks

VF Page:
<apex:page standardController="Previous_Address__c" showHeader="true" recordSetVar="PreviousAdresses">
    
    <apex:form >      
            <apex:pageBlock mode="edit" title="Previous Address">
                    <apex:pageBlockButtons >
                        <apex:commandButton value="Save" action="{!Save}"/>
                        <apex:commandButton value="Cancel" action="{!Cancel}"/>
                    </apex:pageBlockButtons>
                <apex:pageBlockSection title="Previous Address" collapsible="false"  columns="1" >
                    <apex:outputField label="Contact" value="{!Previous_Address__c.Contact__c}"/> 
                    <apex:inputField Label="Address Resident From" value="{!Previous_Address__c.Address_Resident_From_Date__c}"/>
                    <apex:inputField Label="Address Resident To" value="{!Previous_Address__c.Address_Resident_To_Date__c}"/>                       
                    <apex:inputField Label="House Number" value="{!Previous_Address__c.House_Flat_No__c}"/>
                    <apex:inputField Label="House Name" value="{!Previous_Address__c.House_Name__c}"/>
                    <apex:inputField Label="Flat Number" value="{!Previous_Address__c.Flat_Number__c}"/>
                    <pca:Address Street="{!Previous_Address__c.Street__c}" State="{!Previous_Address__c.County__c}" City="{!Previous_Address__c.City__c}" Zip="{!Previous_Address__c.Postcode__c}" Country="{!Previous_Address__c.Country__c}"  > </pca:Address>            
                </apex:pageBlockSection>                     
             </apex:pageBlock> 
        </apex:form>        
</apex:page>

 
Hi New to the community,

Completing my Lightning Experience Reports & Dashboards Specialist superbadge today and recieved this error:

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: KYVMOIPO

I was using a new trailhead playground as stated in the pre course.

Can anyone help?

Thanks
Hi All,

I am trying to create One LoginPage using Visualforce Page. But, I am getting error in this. 

Requirement :

1 > Username is corrct and Password is correct
    It needs to login the page
2 > Username is Wrong and Password is correct
    Error : Plz Enter Valid Username
3 > Username is correct and Password is wrong
    Error : Plz Enter Valid Password
4 > Username is wrong and Password is wrong
    Error : Plz Enter Valid Username and Password.

I am getting unexpected Results. 


VF Code :

<apex:page controller="Sample">
<apex:form >
<apex:pageBlock >

    <br>UserName&nbsp;<apex:inputText label="center" value="{!userName}"/></br>
    <br>Password &nbsp;&nbsp;<apex:inputsecret value="{!password}"/></br>
    <apex:commandButton value="Login" action="{!loginPage}" reRender="Error"/>
    
    <apex:pageMessages id="Error"></apex:pageMessages> 
    
</apex:pageBlock>
</apex:form>
</apex:page>


My code : 


public class Sample {      
    public String userName{get;set;}
    public String password{get;set;}
    public List<Account> returns {get;set;}
    public Sample(){
        returns =new List<Account>();
    }
    public PageReference loginPage(){
        
        Account acc=new Account();
       returns = [select ID, Name, Sic from Account Where Name=:userName and sic=:password];
        if(userName == acc.Name && Password == acc.Sic){
            Pagereference pr = new PageReference('/'+returns[0].Id);
            pr.setReDirect(true);
            return pr;
        }
        
        else if (userName != acc.Name && Password == acc.Sic){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Plz Enter valid UserName'));
            return null;

        }
        else if ( userName == acc.Name  && Password != acc.Sic){
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Plz Enter Valid Password'));
            return null;
        }
        
        else {
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Invalid UserName or Password'));
                return null;
        }
        
    }

}


Thanks in Advance 
Thulasi