• tanushree roy 6
  • NEWBIE
  • 25 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies
I have two filter, One for Month and one for Quarter, and I want to bind these two filter dynamic for my bar chart.
Month Filter is-
"query": "q = load \"AARP_DATA_24OCT\";\nq = group q by 'DATAMONTH_Month';\nq = foreach q generate 'DATAMONTH_Month' as 'DATAMONTH_Month', count() as 'count';\nq = order q by 'DATAMONTH_Month' asc;\nq = limit q 2000;",
Quarter Filter is-
"query": { "measures": [ [ "count", "*" ] ], "groups": [ "DATAMONTH_Quarter" ] },
And my Chart with which have to bind is​​​​​​​
"query": "\nq = load \"AARP_DATA_24OCT\";\nq = filter q by 'BRIOVA_NONBRIOVA_DISP' == \"1\";\nq = group q by 'Therapy';\nq = foreach q generate 'Therapy' as 'Therapy', sum('GROSS_INCOME')/1000000 as 'Briova';\nr = load \"AARP_DATA_24OCT\";\nr = group r by 'Therapy';\nr = foreach r generate 'Therapy' as 'Therapy', sum('GROSS_INCOME')/1000000 as 'Total';\ns = union q ,r;\ns = group s by 'Therapy';\ns = foreach s generate 'Therapy' as 'Therapy', sum('Total') as 'Total', sum('Total')-sum('Briova') as 'Leakage', sum('Briova') as 'Pull Through';\ns = filter s by 'Leakage' > 0;\ns = order s by 'Total' desc;",

How to Bind these two fields in my bar chart?

 
My visual force page--------------------

<apex:page controller="WrapperAcccountWithEachContact" sidebar="false" showHeader="false">
 <style> 
     .Processing{
         position: fixed;
         background: url('/img/loading32.gif');
         background-repeat: no-repeat;
         background-position: center;
         width: 100%;
         height: 100%;
         z-index: 10004;
         left: 0%;
         top: 0%;
          
     }
    </style>
  <apex:form >
  <apex:actionStatus id="status" startStyleClass="Processing"></apex:actionStatus>
  <apex:pageBlock title="Requirement Send Email on Contact from Account Seletion"  >
  
  

  
  <apex:pageBlockSection >
   <apex:selectList size="1" value="{!AccID}" title="data" >
       <apex:selectOptions value="{!AccountSelectList}">
       
       </apex:selectOptions>
       <apex:actionSupport event="onclick" status="status" reRender="dt, table" action="{!Changemethod}"/>
    </apex:selectList> 
  </apex:pageBlockSection>
  <apex:outputPanel id="dt"></apex:outputPanel>
   <apex:pageBlockTable value="{!contactList }" var="c" id="table">
    
                  <apex:column >                   
                    <apex:inputCheckbox value="{!c.selected}" />
                </apex:column>
                    <apex:column value="{!c.con.lastname}"/>
                    <apex:column value="{!c.con.email}"/>
                    
    
    </apex:pageBlockTable>    
    <apex:commandButton value="SendMail" action="{!Changemethod}"/>
            
  </apex:pageBlock>
  </apex:form>

</apex:page>
------------------------------------------------------------------
My Controller Class..

public class WrapperAcccountWithEachContact {

public String AccID{Get;set;}
  public List<wrapper> contactList {get; set;} 
 public List<SelectOption> getAccountSelectList()
    {
        List<SelectOption> AccountSelectList =  new List<SelectOption>();
        AccountSelectList .add(new SelectOption('None','--- None ---'));        
        for(Account acc : [select id , name from Account]){
          AccountSelectList .add(new SelectOption(acc.Id,acc.name));
        }
        return AccountSelectList ;
    }
    
    public pageReference Changemethod()
    {
    List<Messaging.SingleEmailMessage>lstmsg = new List<Messaging.SingleEmailMessage>();
    Messaging.SingleEmailMessage objMail = new Messaging.SingleEmailMessage();
    EmailTemplate temp = [select id from EmailTemplate where name='BirthdayWish Template'];
    
    
    system.debug('AccID:::::::::;;;'+AccID);
    contactList= new list<wrapper>();
    for(contact con: [select id , lastname,email from contact where AccountID =:AccID]){
        wrapper objWrap = new wrapper(con);
        system.debug('objWrap(((((((((((((((((((((((((('+objWrap );
        contactList.add(objWrap);
        if(objWrap.selected==true){
        system.debug('objWrap!!!!!!!!!!!!!!!!!!!!!!'+objWrap);
             
              objMail.setTemplateId(temp.id);
              objMail.setTargetObjectId(objWrap.con.id);
              objmail.setSaveAsActivity(false);
              lstMsg.add(objMail); 
            }
        
    }
    if(lstMsg!=null && lstMsg.size()>0)
        {
            Messaging.sendEmail(lstMsg);
        }
        
       return null; 
    
    }
    
    /*public pageReference sendMail(){
         List<Messaging.SingleEmailMessage>lstmsg = new List<Messaging.SingleEmailMessage>();
         Messaging.SingleEmailMessage objMail = new Messaging.SingleEmailMessage();
         EmailTemplate temp = [select id from EmailTemplate where name='BirthdayWish Template'];
         for(WrapperClass wc:objWrap ){
            if(wc.isCheck==true){
             
              objMail.setTemplateId(temp.id);
              objMail.setTargetObjectId(wc.con.id);
              objmail.setSaveAsActivity(false);
              lstMsg.add(objMail); 
            }
        }
        if(lstMsg!=null && lstMsg.size()>0)
        {
            Messaging.sendEmail(lstMsg);
        }
        PageReference pr = new PageReference('/apex/ForgotPassword');
        pr.setRedirect(true);
        return pr;
    }*/
    
    public class wrapper{
    public Contact con {get; set;}
     public Boolean selected {get; set;}
    
    public wrapper(Contact c) {         
            con = c;
            selected = false;
    }
    }




}

------------------------
Here mail is not going..
Kindly help me out for this

regards
Tanushree Roy
 
Hi,

How to generate report from two or more objects in salesforce?

Thanks
Tanushree Roy
hi,

Can we add java script code in wave analytics json? Actually I want input box in wave dashboard.
can anyone help.

Thanks and regards
Tanushree Roy
Hi,
I did this code there is no error showing when I save this code but still trailhead showing me error..
public class OlderAccountsUtility {
    public static void updateOlderAccounts() {
    
    Account[] oldAccounts = [SELECT Id, Description FROM Account ORDER BY CreatedDate ASC LIMIT 5];
    //update the Description field
    for (Account acct : oldAccounts) {
        acct.Description = 'Heritage Account';
   }
   update oldAccounts;
}
}


and the error is --
Challenge Not yet complete... here's what's wrong: 
The 'updateOlderAccounts' method did not update account records as expected 
Note: you may run into errors if you've skipped previous steps.

And one more thing I want to know that where is the Start Tour option in developer console ??
please help me out..


thanks and regards
Tanushree Roy
Hi,
I did this but i didnt get yellow color for my pageBlockSection..I am getting Black color
Can anyone help m out for this?


<apex:page sidebar="false" showHeader="false">
   <apex:pageBlock title="A Page Block area" >
       <apex:outputPanel styleClass="yellow" layout="block" >
            <apex:pageBlockSection title="Page Block Section" >"Page block section area"</apex:pageBlockSection>
       </apex:outputPanel>
        This is your new Page: Hello world
  </apex:pageBlock> 
</apex:page>

User-added image


 
tanushree...
I used this code but still m getting error...
where is my mistake can any one plz...


public class StringArrayTest {
    public static List<String> generateStringArray(Integer n)
    {
        List<String> myArray = new List<String>();
        for(integer i=0;i<n;i++)
        {
            myArray.add('Test '+i);
            system.debug(myArray[i]);
            
        }
        return myArray;
    }
}


Thanks
Tanushree
 
tanushree...
I used this code but still m getting error...
where is my mistake can any one plz...


public class StringArrayTest {
    public static List<String> generateStringArray(Integer n)
    {
        List<String> myArray = new List<String>();
        for(integer i=0;i<n;i++)
        {
            myArray.add('Test '+i);
            system.debug(myArray[i]);
            
        }
        return myArray;
    }
}


Thanks
Tanushree
 
Create an Apex class that returns an array (or list) of strings: 
Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.

MyApexClass to above Challenge:

public class StringArrayTest {
    
    public static List<string> generateStringArray(Integer n)
    {
        List<String> myArray = new List<String>();
        
        for(Integer i=0;i<n;i++)
        {
            myArray.add('Test'+i);
            System.debug(myArray[i]);
        }
        return myArray;
        
    }


It's compile and execute as per requirement in Developer console. But Traihead showing the below error:

Challenge not yet complete... here's what's wrong: 
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

Anyhelp would be greatly appreciated. Thanks.