• 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 am trying to create a Rolling 12 Months Report in Salesforce.
The formula i have used is as below :
IF( PO_Approval_Date__c <= Vendor__r.Current_CY_As_Of_Date__c -365 , 1, 0)

PO_Approval_Date__c : is a Date field -> Date of Spend.
Vendor__r.Current_CY_As_Of_Date__c : is a Date field -> Max of Date as per the data uploaded in Spend object.

What is basically want to achieve is : For eg: If I have loaded data in my Spend object till Nov2016.Then in 12 months rollling report itn should show me data from Nov 2016 to Dec2015.
Currently by using the above formula its showing me data till Nov2015.
Please help me correct this.

Thanks for All & Any Help in Advance...!!!
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,

Please help whether is it possible to create related list for "New Notes" in Visualforce Page?
If Yes please also guide on how to do that.

Thanks,
R.Sushma.
Hi All,

I have a object Test which has two list views say ListView 1 and ListView2.
In object Test I have a field based on the value (YES or NO) need to display the user either of the list view on tab click.
Currently I am displaying only one listview on tab click using the below :
<apex:page showHeader="true" tabStyle="Test_c" action="/a1t?fcf=00BP0000000WMHv" ></apex:page>
Now need to add condition to it.Please Help...

Thanks in Advance for Any Help...!
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,

I have created some "Custom Components" for my Home Page in Salesforce Classic.
But when i switch to Lightning Experience it doesnt appear in the Home page there.
So Is there a way to darg them on Lightning Home Page or will I have to recreate Custom Lightning Components?

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,

Please can anyone help me know if we can access the files in SFTP via Files Connect and if yes what are the steps to do so?

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.
Hi All,

I have two queries.Please kindly help me get clarity with the below :

1. Can Salesforce For Outlook be configured for Office 365?If yes which version?

2.If Salesforce For Outlook cannot support Office 365 is there any other Salesforce plugin to help syn Events and Emails between the two.


Thanks for Any Help in Advance...:)
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
Does anyone know how to get Outlook 2016 (aka Office 365) SalesForce integration running? I'm in SFDC Professional... Please help!
I am working on a Trailhead Challenge and receive this error when I execute.

User-added image

Create an Apex class that returns contacts based on incoming parameters.

For this challenge, you will need to create a class that has a method accepting two strings. The method searches for contacts that have a last name matching the first string and a mailing postal code (API name: MailingPostalCode) matching the second. It gets the ID and Name of those contacts and returns them.The Apex class must be called 'ContactSearch' and be in the public scope.
The Apex class must have a public static method called 'searchForContacts'.
The 'searchForContacts' method must accept two incoming strings as parameters, find any contact that has a last name matching the first, and mailing postal code matching the second string. The method should return a list of Contact records with at least the ID and Name fields.
The return type for 'searchForContacts' must be 'List<Contact>'.

Here's my code:

User-added image

Can someone assist me? Please.

Thank you,
Darren

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