• Sushma Ramakrishnan
  • NEWBIE
  • 75 Points
  • Member since 2015
  • Software Engineer
  • L&T Infotech Limited

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 35
    Questions
  • 41
    Replies
Hi All,

I have a Dashboard in which the "View dashboard as :" is set as User whoes profile is System Admin.
Now issue is when a User with Non-System Admin Profile is logging in then he is not able to view the Dashbord in Home page.
The reason "View dashboard as :" is set to a User with System Admin Profile is its stopping us to get the right or overall information in Dashboard.

Thanks for Any & All Help in Advance...!
Hi All,

I have made use of analytics:reportChart to display report in my VF page.
my BR is that the user should just be able to view the report but not be able to click on it.
<apex:page standardController="Account" showHeader="False" sidebar="False">  
<script type="text/javascript">
function disableclickfun()
{
    document.getElementById(rc).disabled=true;
}
</script>  
  <apex:pageBlock >
      <apex:pageBlockSection id="TestSpend" title="Test Spend Data Report" columns="1" collapsible="true" showHeader="false">
          <apex:PageBlockSection columns="2" onclick="disableclickfun()" id="rc">          
                 <analytics:reportChart reportId="00Oi0000005damv" size="medium" showRefreshButton="false" cacheResults="false" 
                 filter="[{column:'Test_NAME', operator:'equals', value:'{!$CurrentPage.parameters.name}'}]"  ></analytics:reportChart>
                  
                <analytics:reportChart reportId="00Oi0000005damt" size="medium" showRefreshButton="false" cacheResults="false"
                filter="[{column:'Test_NAME', operator:'equals', value:'{!$CurrentPage.parameters.name}'}]}]"></analytics:reportChart>
           </apex:PageBlockSection>    
      </apex:pageBlockSection>
  </apex:pageBlock>
</apex:page>



Thanks for Any & All Help!
 
Hi All,

I am getting the below error message on click of a Report in my VF Page :
Error message
The below is the part of the code from my VF page throwing error :
<apex:panelGrid columns="3" width="100%"  columnClasses="pbTitle, pbButton" id="panelgrid">
         <apex:pageBlock id="Chart">
                    <apex:pageBlockSection id="spendChart" title="Test Spend Data" columns="1" collapsible="true">                
                        <apex:iframe src="/apex/TestSpendDataReportPage?name={!URLENCODE(Account.Name)}" frameborder="False" scrolling="False" height="420"/>                       
                   </apex:pageBlockSection>
         </apex:pageBlock>
</apex:panelGrid>

Thanks for Any & All Help in Advance...!
Hi All,

I have 3 Profiles(Profile 1,Profile 2,Profile 3) and 3 List Views(List View 1,List View 2 & List View 3):

When user with "Profile 1" loggsin and clicks on "Invoice" object then List View 1 should be displayed on Tab Click.The below is my code for doing that.Within this code now i need to apply "IF Condition for Profile and List View Id".Please help me do this.
<apex:page showHeader="true" tabStyle="Invoice__c" action="/a3R?fcf=00B23000000O2Ou" ></apex:page>

Thanks for Any & All Help...!
Hi All,

I have an Apex Class and have written a Batch Apex and Scheduler Apex Class for it.
When I am trying to run my Batch Job from Developer Console I am getting the below error :

System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out

Since I am a Newbie to Apex Batch Jobs please advise me on how to fix this issue?

Thanks for Any & All Help in Advance...!
Hi All,

The below lines in my Apex Class are not getting covered :
 
global class TestIncidentsEmailProcess implements Schedulable{

   global void execute(SchedulableContext SC){
    try
        {      
         emailProcessing();
        }
         catch(Exception ex)
        {
            System.debug('Exception in method email process: '+ex.getStackTraceString()+':'+ex.getMessage());
        }    
   }   
   public static void emailProcessing(){
   try{
    Set<String> incidentID = new Set<String>();
    List<IncidentsEmail__c> emailRecordsToUpdate = new List<IncidentsEmail__c>();
    Date todaysDate = Date.today();
    List<IncidentsEmail__c> incidentsCreatedOrUpdatedList = [select id,Name,IncidentCreatedDate__c,EmailStatus__c from IncidentsEmail__c where IncidentCreatedDate__c =: todaysDate and EmailStatus__c!='Sent'];
    for(IncidentsEmail__c incidentsEmail :incidentsCreatedOrUpdatedList){

        incidentID.add(incidentsEmail.Name);     
    }
    List<Company_Incidents__c> incList = [select id, Name,company__r.name,company__r.Test_Manager__r.email, Test_Manager_Link_f__c,title__c,Incident__c,Incident_Id__c,Impact__c,Email_Trigger__c,Incident_Formula__c,Open_Date__c from Company_Incidents__c where Id in:incidentID and Email_Trigger__c!='Updated' order by company__r.Test_Manager__r.email,company__r.name,Open_Date__c];
       Map<String, List<Company_Incidents__c>> result = new Map<String, List<Company_Incidents__c>>();
    for (Company_Incidents__c p : incList) {
      String email = p.company__r.Supplier_Manager__r.email;
      if(null != email){
          List<Company_Incidents__c> list1 = result.get(email);
          if (list1 == null) {
              list1 = new List<Company_Incidents__c>();
              result.put(email, list1);
          }
          list1.add(p);
      }
    }         
         for(String emailKey : result.keySet()){
           List<Company_Incidents__c> childList = result.get(emailKey);
          if(childList != NULL && childList.size() > 0){
            List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
            String Content = AutoNotification.IntimateSMO(childList);
            mail.setHtmlBody(Content);
            mail.setPlainTextBody(Content);
            mail.setSaveAsActivity(false);
            mail.setSubject('SupplierForce Incident Notification');
            for(OrgWideEmailAddress owa : [select id, Address, DisplayName from OrgWideEmailAddress]) {
                if(owa.DisplayName.contains('ERM Salesforce Compliance')){
                    mail.setOrgWideEmailAddressId(owa.id); 
                }
            }            
            List<String> toAddress = new List<String>();
             toAddress.add(emailKey);
            mail.setToAddresses(toAddress);
            mails.add(mail);
            Messaging.SendEmailResult[] resultMail =    Messaging.sendEmail(mails, false);
           }
       }        
       List<IncidentsEmail__c> incidentsCreatedOrUpdatedList1 = [select id,Name,IncidentCreatedDate__c,EmailStatus__c from IncidentsEmail__c where IncidentCreatedDate__c =: todaysDate and EmailStatus__c!='Sent'];
       for(IncidentsEmail__c incidentsEmail :incidentsCreatedOrUpdatedList1){
        incidentsEmail.EmailStatus__c = 'Sent';
        emailRecordsToUpdate.add(incidentsEmail);
       }
       System.debug('emailRecordsToUpdate::'+emailRecordsToUpdate);
       update emailRecordsToUpdate;
    }catch(Exception e){
        String recipientAddress = 'suneetha.konda@fmr.com';
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String textbody = 'There has been an error while processing the service manager job from SMIncidents class';
        String textSubject = 'Job error';
        String[] toAddresses = new String[] {recipientAddress};
        mail.setOrgWideEmailAddressId('xxxxxxxxxxxxxxx');
        mail.setToAddresses(toAddresses);
        mail.setSubject(textSubject);        
        mail.setPlainTextBody(textbody);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); 
    }
   
    }
 }
The lines in bold are not getting covered.Have achieved 39% and need to make it 75%.

Thanks for any help in Advance!
 
Hi All,

Below is my Apex Class for which i have got 72% Code coverage and want to make it to 75%.
Apex Class :
public class myWeb2LeadExtension {

    private final Lead weblead;

    public myWeb2LeadExtension(ApexPages.StandardController
                                stdController) {
       weblead = (Lead)stdController.getRecord();
    }

     public PageReference saveLead() {
       try {
       insert(weblead);
       }
       catch(System.DMLException e) {
           ApexPages.addMessages(e);
           return null;
       }
       PageReference p = Page.ThankYou;
       p.setRedirect(true);
       return p;
     }
}

Out of the above lines only the below lines are not getting covered.Please Help...!

PageReference p = Page.ThankYou;
       p.setRedirect(true);
       return p;

Thanks for any help in Advance...!
Hi All,

Need to increase the code coverage of the below Test Class to 75% from 70%.
Test Class :
@isTest
private class updateVisitorActionTest {
  
  
  
  static testMethod void testVisitorAction(){
    
    salyticsusa__Visitor_Action__c sal = new salyticsusa__Visitor_Action__c();
        sal.salyticsusa__Action_ID__c='5360F9BA5AFB4CF79D675C380D7A31FA1';
       sal.salyticsusa__URL__c='https://c.cs14.visual.force.com/apex/Supplierforce_Client_acc_page?id=001i0000006D2vL&sfdc.override=1';
  //      sal.salyticsusa__Visitor_Session__c='a1Si0000001IQsPEAW';
        salyticsusa__Visitor_Session__c ses= new salyticsusa__Visitor_Session__c();
        ses.salyticsusa__Non_Persistent_Session__c='123456756790';
        ses.salyticsusa__Persistent_Session__c='123456ADCVBHFDHKKNG5';
        salyticsusa__Visitor__c visitor= new salyticsusa__Visitor__c();
        visitor.salyticsusa__User_ID__c='005i0000000MgOkAAK';
        insert visitor;
        ses.salyticsusa__Visitor__c=visitor.Id;
        insert ses;
        sal.salyticsusa__Visitor_Session__c=ses.Id;
    insert sal;
    
     
    
  }

}
Trigger :
trigger updateVisitorAction on salyticsusa__Visitor_Action__c (before insert) {

  
 for(salyticsusa__Visitor_Action__c va : trigger.new) {
   string acctId;
   string contactId;
   string url = va.salyticsusa__URL__c;
   System.debug(url);
  if(url!=null){
   if(url.contains('Test_Ext_Cont_page?id=003')&&va.salyticsusa__Contact__c==null){
     System.debug('User viewing Contact with Custom Visual Force Page');
     contactId=url.substring(url.lastIndexOf('?id=')+4, url.lastIndexOf('?id=')+19);
     System.debug(contactId);
       va.salyticsusa__Contact__c= contactId;
           if(va.salyticsusa__Current_Action__c==null&&va.salyticsusa__Current_Object__c==null){
             System.debug('Visitor action and object');
          va.salyticsusa__Current_Action__c='View';
         va.salyticsusa__Current_Object__c='VF Contact Page';
           }
     
   }else if(url.contains('Test_Client_acc_page?id=001')&&va.salyticsusa__Account__c==null){
     System.debug('User viewing Account with Custom visual force Page');
     acctId=url.substring(url.lastIndexOf('?id=')+4, url.lastIndexOf('?id=')+19);
     System.debug(acctId);
     va.salyticsusa__Account__c= acctId;
        if(va.salyticsusa__Current_Action__c==null&&va.salyticsusa__Current_Object__c==null){
          System.debug('Visitor action and object');
        va.salyticsusa__Current_Action__c='View';
          va.salyticsusa__Current_Object__c='VF Account Page';
        }
     
   }

}

}

}
Thanks for any help in Advance...!


 
Trigger Error message
Hi All,

I have written a Trigger on  Event Standard object.
My Trigger error message is : "Upcomming Meetings cannot be deleted". 
Is thr a way by which i can display only this part of the message and have ignored the rest salesforce standard error message.

Thanks In Advance.
Hi All,

I have a field which should allow to enter percentage only between 0.0 and 100.0 including these values.I have tried the below and it was working too but suddenly its not working.Please Help...

OR(
  Test__c >= 0.0,
   Test__c <= 100.0
)

Thanks for any Help in Advance...!
Hi All,

Is Save & New standard button not available in Lightning Experience?

Thanks for any help in Advance!
Hi All,

I have created a Formula Field with return type as 'Date' and have set the value as Today().To store the value of the date i create the record on.But i observe that when i create a record on current date it is auto updating the previously created record with current date/todays date instead of retaining yesterdays date for it/or the date on which it was created.

Thanks for Any Help in Advance...!!
Hi All,

I have a requirement to display the Rolling 12 months data(last 12 months data from current month).
I have only Month and Year fields in my Details Object along with the Value for each month.
Can anyone please help me to write the formula for summing up data for last 12 months from current month and displaying that on Master object.

Any help is highly appreciated...!
Thanks in advance...!
Hi All,

I have a logic on one object that like when a new record is created the status should be set as "Current" and when the second record is created for the same object the status of the previous record should become "Previous" and current record should become "Current".
trigger UpdatePerformanceStatusTrigger on Performance__c (after insert)
{

 UpdatePerformanceStatusUtils.updatePerformanceStatus(Trigger.new);  
  
}


public class UpdatePerformanceStatusUtils
{

//Update existing Performance record Status On Creation Of a New Performance Record

    public static void updatePerformanceStatus(List<Performance__c> performanceList)
    {
      List<Performance__c> objPerformance1 = new List<Performance__c>();
      try
      {
         String vendorId = performanceList[0].Vendor__c; 
         String performanceId = performanceList[0].Id;          
         List<Performance__c> performanceRecords = [select Id , Performance_Status__c from Performance__c where id !=: performanceId and Performance_Status__c = 'Current Record' and Vendor__c =: vendorId];
         for(Performance__c performance1: performanceRecords)
         {
             performance1.Performance_Status__c = 'Previous Record';
             objPerformance1.add(performance1); 
         }
         update objPerformance1;
       }
       catch(DmlException e)
       {
           System.debug('The following exception has occurred: ' + e.getMessage()); 
       }          
    }
    
}

Each Vendor object has many Performance records.When i do this manually it works but when i do it in bulk it doesnt meaning all records have by default status as "Current".
Thanks for any help in advance.

We needed a way to show lists of opportunities on a rolling 12 months basis, or for the next 365 days.

 

Since neither of these functions were available for Opportunity reports, I had to create a custom object, with a formula to be able to get these.

 

I was able to create a formula for an Opportunity report for a rolling 12-month report, it should also work for a Trailing Twelve Month. 

 

First, create a custom object with a formula.  I called mine Rolling Date

 

The formula was:

 

IF(End_Date__c<=TODAY() +365, 1, 0)

 

 

In English, if the End Date of our opportunity is greater than or equal to Today's date plus 365 (days), return 1 if true, and 0 if false.

 

 

THEN: when creating the report I just filter by the names of the folks I want to include and Rolling Date equals 1.

 

The formula won't work for Text, it has to be Number. 

 

It works great, and I assume that by changing the + 365 to a - 365 it will create a TTM report. 

 

I can't believe that there's no Next 365 or Last 365 in the drop-down for report duration.

Message Edited by RuthlessBunny on 03-12-2010 07:48 AM