• Prerna Bhalla
  • 0 Points
  • Member since 2015

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 2
 list<Account> stringList;
  list<Account> stringList1 = new list<Account>();
  list<Account> stringList2 = new list<Account>();
 list<Account> stringList3 = new list<Account>();
  public listTestClass() {
    stringList = new list<Account>();
    stringList= [select id, name, (select id, name from Contacts) from Account limit 2];
  // scenerio 1
    stringList1 = stringList;
//scenerio 2
    for(Account a : stringList ) {

//scenerio 3
Heyy i am in thus situtation that i have 3 picklist picklist 1 picklist 2 and picklist 3 . Picklist 1 is controlling list for picklist 2 and picklist 2 is controlling field for picklist 3. Now i am able to fetch the picklist 2 dependent values based on picklist 1 controlling value. But problem is that on the basis of picklist 2 selectrd value i have to fetch picklist 3 depent values. The same function who return me picklist 2 depent value not returning picklist 3 dependent value for conttolling value from picklist 2. Help me i am stuck in this situation. I am using same above code for dependentency upto 2 1 level showing me correct dependent values but at third level i am not getting any result. Suppose i select fruit dependent value is green colr fruit and yellow color fruit i choose yellow option should show me banana mango like that
I'm trying to update values in case when a task is created inside it, I want to update string value 'Case Status' and increase numeric field by one

My Code is 
trigger CreatTask on Task (after insert) {
    List<Case>  cList = new List<Case>();
    for(Task t: Trigger.new) {
        If(t.whatId.getsObjectType() == Case.sObjectType){
            Case c = new Case();
            c.Id = t.whatId;
            if(t.Status == 'Opened'){
            c.Status = 'In Progress';
            c.Open_Tasks__c = Integer.valueOf(c.Open_Tasks__c) + 1;
        update cList;

But i got error 

caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.OnTaskAdded: line 6, column 1

I am using inputfield to populate picklist on my page but when I select a value and save its not binding, controller not able get value which is selected.
<apex:pageBlockSection  >
    <apex:inputField value="{!country.Languagecode__c}"/>
    <apex:pageBlockSectionItem >
        <apex:CommandButton value="Save" action="{!save}"/>
public class CostomController{
public Country__c country{set;get;}
public CustomController(){
    country = new Country__c();
 public PageReference save(){
   System.debug('selected value:' + country.Languagecode__c);
   return null;

Above debug statement returning " selected value:null "