• Pandeiswari
  • NEWBIE
  • 35 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 11
    Replies
Hello,

I've created a custom VF Page and a custom controller.  I want to add a custom List button to the Opportunity object that will invoke this VF page when pressed.  However, when I try to create the button, my VF page does not appear as an option.  Does anyone know how I can get it to appear?  Thanks.

VF Page:
<apex:page standardController="Opportunity" tabStyle="Opportunity">
    <flow:interview name="Create_Opportunity_w_Parent_Fixed" finishLocation="/p/opp/SelectSearch?addTo={!opportunity.Id}&retURL=%2F{!opportunity.Id}"/>
</apex:page>

VF Controller:
public class OpptyFlowController {

  public Flow.Interview.Create_Opportunity_w_Parent_Fixed OppFlow { get; set; }

    public String getOppID() {
      if (OppFlow==null) return '';
      else return OppFlow.OpptyID;
    }

  public PageReference getOID(){
    PageReference p = new PageReference('/p/opp/SelectSearch?addTo=' + getOppID() + '&retURL=%2F' + getOppID();
    p.setRedirect(true);
  return p;
  }

}


 
Hi,

I have String date as "Jul 27, 2018". How to convert to Date in Apex
Hi,

I have executed "Run all test" to get code coverage of all apex classes. Is there way to get all apex classes code coverage with percentage copy to excel sheet. I am able to see all classes with percentage in Developer console. But not able to copy all those. Please provide some suggestion.
Hi,

I have created approval process on contact object and I would like to make Comments field as mandatory for both Approval and Rejection. Also I would like to save the comments in Notes Section of Contact object. Can anyone please share code.
Hi,

I would like to assign user when contact is creating using round robin or like lead assignment. I refer to lead assignment rules but it will work for cases and Leads. Can anyone please suggest some thoughts to assign it for contact object.
How to get all fields with datatype in Object. I would like to get all fields with data type in contact object
I am planning to take Salesforce developer 501 certification. Is it mandatory to take 401 before taking 501 ceritifcation. Also please suggest some workbooks for doing certifications.

Thank you all.
Hi,
I would like to send emails in bulk in salesforce in apex code. I tried using MassEmailMessage option, But setWhatIds is allowed for only Contract
Case,Opportunity,Product. I would like set whatId with my custom object. Please suggest some solution.
Hi,

I have functionality to send 100 emails when Click on Notify button.

        List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
            for(Contact con : contact)
            {
                Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
                email.setTargetObjectId(con.Id); 
                email.setWhatId(accountId); 
                email.setSaveAsActivity(true);
                mails.add(email);
            }
            if(mails.size()>0)
            {
                Messaging.SendEmailResult [] r = Messaging.sendEmail(mails);
            }    
            
    When emails are sent, it will create Task record in contact. I have trigger on Task Object to update field in account. When 100 task records are getting created, it is calling SOQL query in my below trigger 100 times. Please advice if my trigger is bulkified or is there any issue in Email sending code.
    
    List<account> accountId  = new List<ACcount();
    List<Task> triggerTask = Trigger.new != null ? Trigger.new : Trigger.old;
            for (Task task: triggerTask){
               String accountId = task.WhatId;
               if(task.Status =='Completed' && task.Isclosed==true && task.IsRecurrence == false && accountId !=null){
                   accountId.add(task.whatId);
               }
            } 
      
        
       if(accountId.size()>0){  
           List<accountId> accountList = [SELECT Id, (SELECT Id FROM Tasks where Status='Completed' and Isclosed=true and IsRecurrence = false) FROM Account WHERE Id IN :accountId];
          
           for(Account acc:accountList) {
               if(acc.Tasks != null) {
                     acc.Activities__c= acc.Tasks.size();
                   }
              }
            if(accountList.size()>0){
               update accountList;
            }
        }    

I have two Custom object(Project,Skill). Is there a way to add both the custom object in Salesforce tab using Apex coding. Currently I am adding using customize my tab option and selecting my object. I need this code to add it to Managed package.

Hi,

I have executed "Run all test" to get code coverage of all apex classes. Is there way to get all apex classes code coverage with percentage copy to excel sheet. I am able to see all classes with percentage in Developer console. But not able to copy all those. Please provide some suggestion.
Hi,

I would like to assign user when contact is creating using round robin or like lead assignment. I refer to lead assignment rules but it will work for cases and Leads. Can anyone please suggest some thoughts to assign it for contact object.
How to get all fields with datatype in Object. I would like to get all fields with data type in contact object
Hello Every one,

I need to update the contact when the Case is closed.
I wrote the code but its not triggering.

Below is my code

 public void UpdateRepStatus(List<Case> CompliancesurveryDetailsLists, Map<ID,Case> oldCompliancesurveryDetailsmap)
   {
      set<Id> CaseId= new Set<Id>();
      List<Contact> LstcntUpdate= new List<Contact>();
      List<Case> LstCases=new List<Case>();
      for(Case Cases:CompliancesurveryDetailsLists)
      {
        CaseId.add(Cases.Id);
        CaseId.add(Cases.Contact__c);
      }
      LstCases=[SELECT Id,Status,Contact__c FROM Case where status='closed' AND ID IN:CaseId AND Contact__c  IN: CaseId LIMIT 1];
      system.debug('LstCases====>>>'+LstCases);
      if(LstCases.size()>0)
      {
          for(Case Cases:LstCases)
          {
               contact cnt= new contact();
               cnt.Id=Cases.Contact__c;
               cnt.Rep_Status__c='Terminated';
               LstcntUpdate.add(cnt);
         }
             update LstcntUpdate;
      }

Trigger Class


    if(Trigger.isBefore && Trigger.isUpdate) {
    CasesTriggerHandler.UpdateRepStatus(Trigger.New, Trigger.oldMap);
   }

thanks for help.

Regards,
Jyo
Hello,

I've created a custom VF Page and a custom controller.  I want to add a custom List button to the Opportunity object that will invoke this VF page when pressed.  However, when I try to create the button, my VF page does not appear as an option.  Does anyone know how I can get it to appear?  Thanks.

VF Page:
<apex:page standardController="Opportunity" tabStyle="Opportunity">
    <flow:interview name="Create_Opportunity_w_Parent_Fixed" finishLocation="/p/opp/SelectSearch?addTo={!opportunity.Id}&retURL=%2F{!opportunity.Id}"/>
</apex:page>

VF Controller:
public class OpptyFlowController {

  public Flow.Interview.Create_Opportunity_w_Parent_Fixed OppFlow { get; set; }

    public String getOppID() {
      if (OppFlow==null) return '';
      else return OppFlow.OpptyID;
    }

  public PageReference getOID(){
    PageReference p = new PageReference('/p/opp/SelectSearch?addTo=' + getOppID() + '&retURL=%2F' + getOppID();
    p.setRedirect(true);
  return p;
  }

}


 
I want to include the following on a Visualforce page, in reference to the page itself: 'This page was last modified by xxxxname on xxxxdate.'
My company has a very extensive app (call it app1) being built in an enterprise org. Another department wants its own app (call it app2)  and also this app2 would need read only access to objects in app1. Would it be possible to build app2 as a managed package (we don't need to share code just data). If app2 somehow has to be merged with app1 then builds and release management becomes quite complex and I would like to avoid that. Any help here would be appreciated. 
  • March 11, 2015
  • Like
  • 1
Hi,

I have functionality to send 100 emails when Click on Notify button.

        List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
            for(Contact con : contact)
            {
                Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
                email.setTargetObjectId(con.Id); 
                email.setWhatId(accountId); 
                email.setSaveAsActivity(true);
                mails.add(email);
            }
            if(mails.size()>0)
            {
                Messaging.SendEmailResult [] r = Messaging.sendEmail(mails);
            }    
            
    When emails are sent, it will create Task record in contact. I have trigger on Task Object to update field in account. When 100 task records are getting created, it is calling SOQL query in my below trigger 100 times. Please advice if my trigger is bulkified or is there any issue in Email sending code.
    
    List<account> accountId  = new List<ACcount();
    List<Task> triggerTask = Trigger.new != null ? Trigger.new : Trigger.old;
            for (Task task: triggerTask){
               String accountId = task.WhatId;
               if(task.Status =='Completed' && task.Isclosed==true && task.IsRecurrence == false && accountId !=null){
                   accountId.add(task.whatId);
               }
            } 
      
        
       if(accountId.size()>0){  
           List<accountId> accountList = [SELECT Id, (SELECT Id FROM Tasks where Status='Completed' and Isclosed=true and IsRecurrence = false) FROM Account WHERE Id IN :accountId];
          
           for(Account acc:accountList) {
               if(acc.Tasks != null) {
                     acc.Activities__c= acc.Tasks.size();
                   }
              }
            if(accountList.size()>0){
               update accountList;
            }
        }    

Hi All,

 

I want to get all fieldnames of a object in apex. How can I do this?

 

For example for User object I want to get all its field names like AboutMe, AccountId , Email etc.

 

Any help on this really appreciated.

 

Regards,

Naren

  • January 18, 2012
  • Like
  • 0

Hello everybody, This is my first Salesforce post.

 

In my controller, I use a query to get the field related to a rich text area.

My need is to get, for example, 200 first character of a rich text area without HTML markup.

 

I don't know if a method already exists to perform this because when I try to change the field type from rich text area to text area, Salesforce propose if I want to keep or not the HTML markup of rich text area contents.

 

Thank you

M.

  • March 11, 2011
  • Like
  • 0