• Naresh_reddy
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
what we need to fetch all records present in paymentlineitems from payment,using parent to child nested relation ship query.
how to write this query?
can any one help me
please check below User-added image
How to call the method in java script and example ? can anone know please reply?
Can any one help me in wriiting test class for below code?


public class picklistinVfCont 
{
public String state { get; set; }
public String city { get; set; }
    
    public List<SelectOption> getStates() {
        List<SelectOption> stOptions = new List<SelectOption>();
        stOptions.add(new SelectOption('None','--None--'));
        stOptions.add(new SelectOption('AP','Andhra Pradesh'));
        stOptions.add(new SelectOption('TN','Tamil Nadu'));
        stOptions.add(new SelectOption('KA','Karnataka'));
        return stOptions;
    }

    public List<SelectOption> getCities() {
        List<SelectOption> ciOptions = new List<SelectOption>();
        if(state=='AP'){
            ciOptions.add(new SelectOption('VSKP','Vishakapatnam'));
            ciOptions.add(new SelectOption('BZA','Vijayawada'));
            ciOptions.add(new SelectOption('TPTY','Tirupati'));
        }
        else if(state=='TN'){
            ciOptions.add(new SelectOption('CHE','Chennai'));
            ciOptions.add(new SelectOption('CBE','Coimbatore'));
        }
        else if(state=='KA'){
            ciOptions.add(new SelectOption('SBC','Bangalore'));
            ciOptions.add(new SelectOption('MAQ','Mangalore'));
        }
        else if(state=='None'){
            ciOptions.add(new SelectOption('None','--None--'));
        }
        return ciOptions;
    }
}



================================================================================

<apex:page controller="picklistinVfCont">
  <apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:outputLabel >State</apex:outputLabel>
                <apex:pageblockSectionItem >                
                    <apex:selectList size="1" value="{!state}">
                        <apex:selectOptions value="{!states}"/>
                            <apex:actionSupport event="onchange" reRender="a"/>
                    </apex:selectList>                
                </apex:pageblockSectionItem>
                
                <!--CITY--->
            <apex:outputLabel value="City"/>       
            <apex:pageblockSectionItem >
                <apex:selectList size="1" value="{!city}" id="a">
                    <apex:selectOptions value="{!cities}"/>
                </apex:selectList>
            </apex:pageblockSectionItem>      
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>





 
Can any one help me in wriiting test class for below code?


public class picklistinVfCont 
{
public String state { get; set; }
public String city { get; set; }
    
    public List<SelectOption> getStates() {
        List<SelectOption> stOptions = new List<SelectOption>();
        stOptions.add(new SelectOption('None','--None--'));
        stOptions.add(new SelectOption('AP','Andhra Pradesh'));
        stOptions.add(new SelectOption('TN','Tamil Nadu'));
        stOptions.add(new SelectOption('KA','Karnataka'));
        return stOptions;
    }

    public List<SelectOption> getCities() {
        List<SelectOption> ciOptions = new List<SelectOption>();
        if(state=='AP'){
            ciOptions.add(new SelectOption('VSKP','Vishakapatnam'));
            ciOptions.add(new SelectOption('BZA','Vijayawada'));
            ciOptions.add(new SelectOption('TPTY','Tirupati'));
        }
        else if(state=='TN'){
            ciOptions.add(new SelectOption('CHE','Chennai'));
            ciOptions.add(new SelectOption('CBE','Coimbatore'));
        }
        else if(state=='KA'){
            ciOptions.add(new SelectOption('SBC','Bangalore'));
            ciOptions.add(new SelectOption('MAQ','Mangalore'));
        }
        else if(state=='None'){
            ciOptions.add(new SelectOption('None','--None--'));
        }
        return ciOptions;
    }
}



================================================================================

<apex:page controller="picklistinVfCont">
  <apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:outputLabel >State</apex:outputLabel>
                <apex:pageblockSectionItem >                
                    <apex:selectList size="1" value="{!state}">
                        <apex:selectOptions value="{!states}"/>
                            <apex:actionSupport event="onchange" reRender="a"/>
                    </apex:selectList>                
                </apex:pageblockSectionItem>
                
                <!--CITY--->
            <apex:outputLabel value="City"/>       
            <apex:pageblockSectionItem >
                <apex:selectList size="1" value="{!city}" id="a">
                    <apex:selectOptions value="{!cities}"/>
                </apex:selectList>
            </apex:pageblockSectionItem>      
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>