• sriharisfdc reddy
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 6
    Replies
Anybody knows cookies base authentication. I want to show the Pentaho dashboard to the salesforce account page. Can you please help. How to authenticate in the cookie class.how to put user name and password in the cookie and how to get the username and password through apex cookie class. Please help me.
Hi one account have multple related list project and case.prject and case open and closed activities iam showing account page.but i want all 3 list i want sort order.based on the due date i want sort order.please help me.

public class TicketsAndOpenActivitiesController{
    public List<case> theCase {get;set;}
    public List<Project__c> theProject {get;set;}
    public List<Account> theAccount {get; set;}
    public List<OpenActivity> openActivities {get;set;}
    public List<ActivityHistory> historyList {get;set;}
    public List<OpenActivity> finalOpenList {get;set;}
    public List<ActivityHistory> finalCloseList {get;set;}
    public Account acc;
    public case acc1;
    public Project__c acc2;
    
    public TicketsAndOpenActivitiesController(ApexPages.StandardController controller){
        openActivities = new List<OpenActivity>();
        historyList = new List<ActivityHistory>();
 this.acc=(Account)controller.getRecord();
        
        theAccount = [SELECT id,name,(SELECT id,Subject,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,what.type,
                                   IsTask, ActivityDate, Status, Priority, OwnerId FROM OpenActivities Where What.type='Account' ORDER BY ActivityDate DESC),(SELECT id,Subject,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,what.type,
                                    ActivityDate,IsTask, Status, Priority, OwnerId FROM activityhistories Where What.type='Account' ORDER BY ActivityDate DESC) 
                   From Account where Id=:acc.id];
        
       for(Account acc : theAccount){
            if(acc.OpenActivities.size() > 0){
                openActivities.addAll(acc.OpenActivities);
                
             }
        }
        for(Account acc : theAccount){
            if(acc.activityhistories.size() > 0){
                historyList.addAll(acc.activityhistories);
                
             }
        }
        
        theCase = [SELECT id,CaseNumber,Subject ,AccountId,(SELECT Subject,Id,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,What.type,IsTask,ActivityDate, Status, Priority, OwnerId FROM OpenActivities where what.type='case' ORDER BY ActivityDate DESC),
                   (SELECT id,Subject,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,what.type,
                                    ActivityDate,IsTask, Status, Priority, OwnerId FROM activityhistories Where What.type='case' ORDER BY ActivityDate DESC)  
                   FROM case where AccountId=:acc.id];
        
        for(Case c : theCase){
            if(c.OpenActivities.size() > 0){
                openActivities.addAll(c.OpenActivities);
            }
        }
        for(Case c : theCase){
            if(c.activityhistories.size() > 0){
                historyList.addAll(c.activityhistories);
                
             }
        }
        
        
        theProject = [SELECT id ,Customer__c,(SELECT Subject,Id,Owner.Name,WhoId,Who.Name,WhatId,ActivitySubtype,What.type,What.Name,IsTask, ActivityDate, Status, Priority, OwnerId FROM OpenActivities where what.type='Project__c' ORDER BY ActivityDate DESC) ,
                      (SELECT id,Subject,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,what.type,
                                    ActivityDate,IsTask, Status, Priority, OwnerId FROM activityhistories Where What.type='Project__c' ORDER BY ActivityDate DESC)
                     FROM Project__c where Customer__c=:acc.id];  
     
        for(Project__c Project : theProject){
            if(Project.OpenActivities.size() > 0){
                openActivities.addAll(Project.OpenActivities);
            }
        }
        for(Project__c Project : theProject){
            if(Project.activityhistories.size() > 0){
                historyList.addAll(Project.activityhistories);
                
             }
        }
}
}
 
export Excel button in vf page not working in lightning
Hi all, I have Button in Vf page that button is working fine in classic but its not working in lightning.
pls help me 
thanksUser-added image
i have created vf page with jquery .jquery exporttoexcel button working fine in google chrome classic and lightning and Firefox classic.but exporttoexcel button not working in lightning.
<apex:page controller="ContractAnalysisReport1" sidebar="false" showHeader="true" readOnly="true" >
    <apex:form >
        <html>
            <head>
                <apex:slds />
                <apex:includescript value="//code.jquery.com/jquery-1.12.4.min.js" / >
                <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
                <apex:includeScript value="//cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"/>
                <apex:stylesheet value="https://cdn.datatables.net/buttons/1.3.1/css/buttons.dataTables.min.css"/>
                <apex:stylesheet value="https://cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css"/>
                <apex:includescript value="//code.jquery.com/jquery-1.12.4.js"/>
                <apex:includescript value="https://cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"/>
                <apex:includescript value="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap.min.js"/>
                <apex:includescript value="https://cdn.datatables.net/buttons/1.3.1/js/dataTables.buttons.min.js"/>
                <apex:includescript value="//cdn.datatables.net/buttons/1.3.1/js/buttons.flash.min.js"/>
                <apex:includescript value="//cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"/>
                <apex:includescript value="//cdn.datatables.net/buttons/1.3.1/js/buttons.html5.min.js"/>
                <apex:includescript value="//cdn.datatables.net/buttons/1.3.1/js/buttons.print.min.js"/>
                <apex:includescript value="//cdn.rawgit.com/bpampuch/pdfmake/0.1.27/build/vfs_fonts.js"/>
                <apex:includescript value="//cdn.datatables.net/buttons//js/buttons.html5.min.js"/>
                <apex:includescript value="//code.jquery.com/jquery-1.12.4.min.js" / >
                <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
                <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
                <!-- <apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
                    <apex:includeScript value="https://cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css"/> -->
                <style>
                    .standard-grid, .standard-grid td, .standard-grid th {
                    border:1px solid rgb(216, 221, 230);
                    }
                    .standard-grid1, .standard-grid1 td, .standard-grid1 th {
                    border:1px solid rgb(216, 221, 230);
                    }
                    .full-width {
                    width: 100%;
                    }
                    .brandPrimaryBrd
                    {   
                    width: 98% !important;
                    overflow: auto;
                    margin: 0px auto;
                    }
                    .dt-buttons
                    {
                    height: 34px;
                    }
                    select {height:30px !important;
                    background-color: #fff;
                    color: #16325c;
                    }
                    .dataTables_filter input {height:30px !important;
                    background-color: #fff;
                    color: #16325c;
                    border: 1px solid #d8dde6;
                    border-radius: .25rem;
                    width: 70%;
                    transition: border .1s linear,background-color .1s linear;
                    display: inline-block;
                    padding: 0 1rem 0 .75rem;
                    line-height: 1.875rem;
                    min-height: calc(1.875rem + (1px * 2));
                    }
                    .buttons-html5{    padding-left: 1rem !important;
                    padding-right: 1rem !important;
                    text-align: center !important;
                    vertical-align: middle !important;
                    border: 1px solid #d8dde6 !important;
                    background-color: #fff !important;
                    font-weight: bold;
                    }
                    #contacttable2_wrapper{
                    }
                    #contacttable2 th{white-space: normal;}
                    #contacttable th{white-space: normal;}
                </style>
                <script>
                    j$ = jQuery.noConflict();
                    j$(document).ready( function () {
                    var contactTable = j$('[id$="contacttable"]').DataTable({
                    "dom": 'Blftip',
                    "sScrollY": "500px",
                    "sScrollX": "100px",
                    "scrollCollapse": true,
                    lengthMenu: [[ 10, 25, 50,100, -1 ],[ '10', '25', '50','100', ' All' ]],   
                    
                    buttons: [
                    {
                    extend: 'excelHtml5',
                    text: '<img src="https://www.questionpro.com/images/qphome/tour/sample-reports/MSExcelExport.png" style="height: 20px;"> Export to Excel',
                    filename: 'Contract Analysis Report',
                    
                    exportOptions: {
                    modifier: {
                    page: 'current'
                    }
                    }
                    },
                    ],
                    
                    initComplete: function() {
                    var api = this.api();
                    var select = j$('[id$=accountSelect1]');
                    $('[id$=accountSelect1]').prepend("<option value=''>None</option>").val('');
                    api.column(1).data().unique().sort().each( function ( d, j ) {  
                    var tempValue=j$(d).text().trim();  
                    if(tempValue != "")
                    {
                    select.append( '<option value="'+tempValue+'">'+tempValue+'</option>' )
                    }
                    } );   
                    }
                    });
                    
                    j$('[id$=accountSelect1]').change(function() {
                    var val = j$.fn.dataTable.util.escapeRegex(
                    j$(this).val()
                    );                   
                    contactTable.column(1)
                    .search( val == '' ? '' :val, true, false )
                    .draw();
                    });
                    
                    j$('[id$=job]').change(function() {
                    
                    var val = j$.fn.dataTable.util.escapeRegex(
                    j$(this).val()
                    );                   
                    contactTable.column(4)
                    .search( val == '' ? '' :val, true, false )
                    .draw();
                    });
                    
                    
                    
                    j$('[id$=outcome]').change(function() {
                    
                    var val = j$.fn.dataTable.util.escapeRegex(
                    j$(this).val()
                    );                   
                    contactTable.column(5)
                    .search( val == '' ? '' :val, true, false )
                    .draw();
                    });
                    
                    
                    
                    });
                    
                    
                    
                    
                   
                    
                    
                    
                </script>
         
decimal bu=0;
        decimal se=0;
        decimal tot = 0;
        string tot1;
        total.clear();
       imbalances1=[SELECT sum(BuyFormula__c) BUY,sum(sellFormula__c) SELL, meter_dum__c meter FROM dealsheet__c where End_Date__c>=:datePicker and Start_Date__c<=:datePicker and  meter_dum__c <> null GROUP BY meter_dum__c ];
       for (AggregateResult ar :  imbalances1)  {
           if(ar.get('buy')==null){bu=0;}
           else{bu=(decimal)ar.get('BUY');}
            if(ar.get('SELL')==null){se=0;}
           else{se= (decimal) ar.get('SELL');}
           tot=bu-se;
            system.debug(bu);
           system.debug(se);
          system.debug(tot);
         //    tot1=(string)tot;
           
          total.add(tot);
           // system.debug('total:'+total.get(0));
       }
       }

I am unable to write Test Code for this code ....any one can help me

thanking u... 
User-added image
This is my html template code i have CP_Address_Line1__c and CP_Address_Line2__c..now suppose i am not taken the field value for CP_Address_Line__c and am send mail...in that mail that Attn is moving up wards..my requiremet is that if i did not take any field that Attn is should be there only what should i do?
Original question:
hi friends
 I am created onee vf page in that i am created i am script 
like
<script>
 function show(){
  alert('...');
}
show i am called in Command Button

now my requirement is when pop up coms then i hav to create
alert box with this
do you want to resend email
     yes   no
if he clickss yes email should go
if he clicks no that reord sholud be updated
the vf page is for updation only
 in the vf i am taken two extensions
<apex:commandbutton action="{!Addrecord}" value="update"/>

no how could i write for send emails
in the controller sendemail() method is there 
Hi one account have multple related list project and case.prject and case open and closed activities iam showing account page.but i want all 3 list i want sort order.based on the due date i want sort order.please help me.

public class TicketsAndOpenActivitiesController{
    public List<case> theCase {get;set;}
    public List<Project__c> theProject {get;set;}
    public List<Account> theAccount {get; set;}
    public List<OpenActivity> openActivities {get;set;}
    public List<ActivityHistory> historyList {get;set;}
    public List<OpenActivity> finalOpenList {get;set;}
    public List<ActivityHistory> finalCloseList {get;set;}
    public Account acc;
    public case acc1;
    public Project__c acc2;
    
    public TicketsAndOpenActivitiesController(ApexPages.StandardController controller){
        openActivities = new List<OpenActivity>();
        historyList = new List<ActivityHistory>();
 this.acc=(Account)controller.getRecord();
        
        theAccount = [SELECT id,name,(SELECT id,Subject,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,what.type,
                                   IsTask, ActivityDate, Status, Priority, OwnerId FROM OpenActivities Where What.type='Account' ORDER BY ActivityDate DESC),(SELECT id,Subject,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,what.type,
                                    ActivityDate,IsTask, Status, Priority, OwnerId FROM activityhistories Where What.type='Account' ORDER BY ActivityDate DESC) 
                   From Account where Id=:acc.id];
        
       for(Account acc : theAccount){
            if(acc.OpenActivities.size() > 0){
                openActivities.addAll(acc.OpenActivities);
                
             }
        }
        for(Account acc : theAccount){
            if(acc.activityhistories.size() > 0){
                historyList.addAll(acc.activityhistories);
                
             }
        }
        
        theCase = [SELECT id,CaseNumber,Subject ,AccountId,(SELECT Subject,Id,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,What.type,IsTask,ActivityDate, Status, Priority, OwnerId FROM OpenActivities where what.type='case' ORDER BY ActivityDate DESC),
                   (SELECT id,Subject,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,what.type,
                                    ActivityDate,IsTask, Status, Priority, OwnerId FROM activityhistories Where What.type='case' ORDER BY ActivityDate DESC)  
                   FROM case where AccountId=:acc.id];
        
        for(Case c : theCase){
            if(c.OpenActivities.size() > 0){
                openActivities.addAll(c.OpenActivities);
            }
        }
        for(Case c : theCase){
            if(c.activityhistories.size() > 0){
                historyList.addAll(c.activityhistories);
                
             }
        }
        
        
        theProject = [SELECT id ,Customer__c,(SELECT Subject,Id,Owner.Name,WhoId,Who.Name,WhatId,ActivitySubtype,What.type,What.Name,IsTask, ActivityDate, Status, Priority, OwnerId FROM OpenActivities where what.type='Project__c' ORDER BY ActivityDate DESC) ,
                      (SELECT id,Subject,ActivitySubtype, Owner.Name,WhoId,Who.Name,WhatId,What.Name,what.type,
                                    ActivityDate,IsTask, Status, Priority, OwnerId FROM activityhistories Where What.type='Project__c' ORDER BY ActivityDate DESC)
                     FROM Project__c where Customer__c=:acc.id];  
     
        for(Project__c Project : theProject){
            if(Project.OpenActivities.size() > 0){
                openActivities.addAll(Project.OpenActivities);
            }
        }
        for(Project__c Project : theProject){
            if(Project.activityhistories.size() > 0){
                historyList.addAll(Project.activityhistories);
                
             }
        }
}
}
 
decimal bu=0;
        decimal se=0;
        decimal tot = 0;
        string tot1;
        total.clear();
       imbalances1=[SELECT sum(BuyFormula__c) BUY,sum(sellFormula__c) SELL, meter_dum__c meter FROM dealsheet__c where End_Date__c>=:datePicker and Start_Date__c<=:datePicker and  meter_dum__c <> null GROUP BY meter_dum__c ];
       for (AggregateResult ar :  imbalances1)  {
           if(ar.get('buy')==null){bu=0;}
           else{bu=(decimal)ar.get('BUY');}
            if(ar.get('SELL')==null){se=0;}
           else{se= (decimal) ar.get('SELL');}
           tot=bu-se;
            system.debug(bu);
           system.debug(se);
          system.debug(tot);
         //    tot1=(string)tot;
           
          total.add(tot);
           // system.debug('total:'+total.get(0));
       }
       }

I am unable to write Test Code for this code ....any one can help me

thanking u... 
Original question:
hi friends
 I am created onee vf page in that i am created i am script 
like
<script>
 function show(){
  alert('...');
}
show i am called in Command Button

now my requirement is when pop up coms then i hav to create
alert box with this
do you want to resend email
     yes   no
if he clickss yes email should go
if he clicks no that reord sholud be updated
the vf page is for updation only
 in the vf i am taken two extensions
<apex:commandbutton action="{!Addrecord}" value="update"/>

no how could i write for send emails
in the controller sendemail() method is there 

Hi All,

 

I require an urgent help.

 

The requirement is that i need to provide a custom button on the Default List View Page to send an Email to the selected record's Email Id field.

 

The records will be selected using the Action Checkbox provided i.e. i need to check the CheckBox provided under Action column to select the records, and after selecting the records click on the Custom button to send the Email to all.

 

Can it be done, if yes please let me know How....Its urgent Please..