• Parteek Kumar 5
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies
HI,

I want to add custom pagination in visualforce page. i have 45000 records in object. but offset only support for 2000 record. i am not getting how to fix this issue.

Please help me guys...
 
Hi All,

I am using a visualforce page for showing task and lead data using wrapper class. In this page I have to use sorting according to priority and activity date. i am not able to understand how to achieve this.
below is my code...
 
public class wrapper implements Comparable
    {
        public decimal st{get;set;}
        public task t{get;set;}
        public string wid{get;set;}
        public wrapper(decimal s,task td,string wi)
        {
           st=s;
           t=td;
           wid=wi;
        }
        public Integer compareTo(Object compareTo) 
        {
        
            wrapper compareToEmp = (wrapper)compareTo;
            
            if(t.priority==compareToEmp.t.priority)
            { return 0;}
            else if(t.priority>compareToEmp.t.priority) 
            {return 1;}
            
            else
            {
                if(t.activitydate==compareToEmp.t.activitydate) return 0;
                if (t.activitydate < compareToEmp.t.activitydate) return 1;
            }
            
            return -1;

            
        }
        

        
         
     }

Please help me guys....
 
Hi All,

I have a variable of get set type, I am showing this variable value on visualforce page using outputtext tag. Now user wants to edit this outputtext value on double click. I am also using inlineeditsupport tag for achive this but this is not working with ouputtext tag.

Please help me...
Hi All,

i have to create a vf page which will import and export data from AL3 files. i am new salesforce and i have no idea to do this.
please help me....

Thanks,
Parteek
Hi All,

I have a visualforce page which showing some contact records in pageblocktable. I have four column in pageblocktable like name, phone, Email, LeadSource. Now i want to add input text box on each column for add search functionality on each column. I am not getting how to achieve this.

User-added image

Please help me...
Thanks,
Parteek
HI All,

I have created a page with tree nodes. On first level i am showing Account, second level - Contact, third level - Case. Now i want to show the contact record detail page on the side of tree node when i click on any contact record from tree nodes. But i am not able to understand how to get that particular contact record id when i click on this. this is my page and code.

User-added image
public class treenodes
{

    public PageReference contid() {
        return null;
    }

   // public ID contid{get;set;}
    /* Wrapper class to contain the nodes and their children */
    public class cNodes
    {    
        public ID contid{get;set;}
        public List<Contact> parent {get; set;}
        Public Account gparent {get;set;}
        public cNodes(Account  gp, List<Contact> p)
        {       
            parent = p;       
            gparent = gp;  
           // contid = ids;
           System.debug('contactid>>>>>>'+parent); 
           System.debug('Accountid>>>>>>'+gparent); 
        }  
    }
    /* end of Wrapper class */
    Public List<cNodes> hierarchy;
    Public List<cNodes> getmainnodes()
    {
        hierarchy = new List<cNodes>();
        List<Account> tempparent = [Select Id,Name from Account];
        for (Integer i =0; i< tempparent.size() ; i++)
        {
            List<Contact> tempchildren = [Select Id,FirstName,LastName,(Select Id,CaseNumber,Subject from Cases) from Contact where AccountId = :tempparent[i].Id];
            hierarchy.add(new cNodes(tempparent[i],tempchildren));
        }
        return hierarchy;
    }
}
<apex:page sidebar="false" controller="treenodes" showheader="false">
  <!-- Include the Jquery Script files -->     
  <link rel="stylesheet" href="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.treeview.css')}"/>    
  <script src="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.js')}" type="text/javascript"></script>     
  <script src="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.cookie.js')}" type="text/javascript"></script>     
  <script src="{!URLFOR($Resource.Jtreeview,'Jquerytreeview/jquery.treeview.js')}" type="text/javascript"></script>
  <!-- End of Javascript files --> 
  <script type="text/javascript">         
  $(function() 
  {             
  $("#tree").treeview({                 
  collapsed: false,                 
  animated: "slow",                 
  control:"#sidetreecontrol",                 
  persist: "location"            
  });          }) 
  </script>  <br/> <br/> <br/> 
  <!-- Tree --> 
      <table style="width:100%">
          <tr>
              <td style="30%">
                  <div id="sidetreecontrol">
            <a href="?#"><font style="color:blue;">Collapse All</font></a> | <a href="?#"><font style="color:blue;">Expand All</font></a>
        </div>  
        <ul id="tree">     
          <apex:repeat value="{!mainnodes}" var="parent">         
                <li><strong><apex:outputtext style="color:blue;" escape="false" value="{!parent.gparent.Name}"/></strong>              
                  <ul>                  
                      <apex:repeat value="{!parent.parent}" var="child">                     
                          <li><span class="formattextcon"><apex:outputtext style="color:green;" escape="false" value="{!child.LastName}"/>
                          </span>                         
                              <ul>                             
                                  <apex:repeat value="{!child.Cases}" var="gchildren">                                
                                      <li> 
                                          <span class="formattextcon"> 
                                              <apex:outputtext escape="false" style="color:red;" value="{!gchildren.CaseNumber}"/> <b>||</b> &nbsp;
                                              <apex:outputtext escape="false" value="{!gchildren.Subject}"/> 
                                          </span> 
                                      </li>                             
                                  </apex:repeat>                        
                              </ul>                            
                          </li>                  
                        </apex:repeat>                
                    </ul>           
                </li>     
            </apex:repeat> 
        </ul> 
              </td>
              <td style="70%">
                  <apex:pageblock >
                      <apex:pageblocktable value="{!mainnodes}" var="a">
                          <apex:column value="{!a.gparent.Name}"/>
                      </apex:pageblocktable>
                  </apex:pageblock>
              </td>
          </tr>      
      </table>
        
        
  <!-- End of Tree -->        
</apex:page>
please help me..

Thanks,
Parteek
Hi All,

I am trying to write a trigger which autoconvert lead in to person account and opportunity. this trigger is working fine on after Insert but when i am trying to add after update event then trigger is throwing error on both insert and update.
Error: update failed, reference id not found..
this is my code.
 
trigger testConvert on Lead (after insert,after update) {
    Set<String> leademails = new Set<String>();
    List<Lead> newLeads = new List<Lead>();
    String LastNme;

    // Get all the new leads
    if(trigger.isInsert)
    {
        for(Lead l : trigger.new){
            if(l.QuoteProductTitle__c != null){
                newLeads.add(l);
                leademails.add(l.email);
                LastNme = l.LastName;
                System.debug('firstDebug>>>>'+l);
            }
            else{
                System.debug('SecondDebug>>>>'+l);
            }
            
        }
    }
   else if 
(trigger.isUpdate){
        for(Lead l : trigger.New){
            if(l.QuoteProductTitle__c != null){
                newLeads.add(l);
                leademails.add(l.email);
                LastNme = l.LastName;
                System.debug('newLeadsDebug>>>>'+newLeads);
            }
            else{
                System.debug('SecondDebug>>>>'+l);
            }
            
        }
    }
    /* Make some maps of account and email addresses */
    List<Account> AccountList = [select Id, PersonEmail, OwnerId, LastName from Account where PersonEmail IN: leademails and LastName =:LastNme];
    Map<ID, String> peAccounts = new Map<ID, String>();
    Map<ID, ID> peAccountsOwner = new Map<ID, ID>();
  //  Map<ID, String> peAccountLName = new Map<ID, String>();

    // Generic map for preventing loss of ids
  //  if(AccountList.size() > 0){
        for(Account a : AccountList){
            peAccounts.put(a.id, a.PersonEmail);
            peAccountsOwner.put(a.id, a.OwnerId);
           // peAccountLName.put(a.id, a.LastName);
           System.debug('ThirdDebug>>>>'+a);
        }
  //  }
    // We will need this to get the id from the email address
    Map<String, ID> peAccountsFlipped = new Map<String, ID>();
    for(ID i : peAccounts.keyset()){
        peAccountsFlipped.put(peAccounts.get(i), i);
        System.debug('FourDebug>>>>'+i);
    }
    
    /* System Conversion Requirements */
    leadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
    List<Database.LeadConvert> leadConverts = new List<Database.LeadConvert>();
    Database.LeadConvert lc = new Database.LeadConvert();

    /* Configuring Payload */    
    for (Lead nl : newleads) {
        lc = new Database.LeadConvert();
        lc.setLeadId(nl.id);
        lc.setOverwriteLeadSource(false);
        lc.setConvertedStatus(convertStatus.MasterLabel);
        System.debug('FifthDebug>>>>');
        // Check to see if account already exists
        if(!peAccounts.isEmpty()){
            if(peAccountsFlipped.get(nl.email)!=null){
                lc.setAccountId(peAccountsFlipped.get(nl.email));
                lc.setOwnerId(peAccountsOwner.get(peAccountsFlipped.get(nl.email)));
                lc.setDoNotCreateOpportunity(false);
                lc.setOpportunityName(nl.QuoteProductTitle__c);
                System.debug('SixthDebug>>>>'+lc);
            }    
        } else {
            // In the event an account doesn't exist
            lc.setOwnerId(nl.OwnerId);
            lc.setDoNotCreateOpportunity(false);
            lc.setOpportunityName(nl.QuoteProductTitle__c);
            System.debug('SeventhDebug>>>>'+lc);
        }
        leadConverts.add(lc);
       //System.debug('leadConverts>>>>'+leadConverts);
    }

    // Fire Payload
    System.debug('leadConverts>>>>'+leadConverts);
   if(leadConverts.size()>0) 
   {
        system.debug('lead converted ');
        Database.LeadConvertResult[] lcr = Database.convertLead(leadConverts);
   }
    else
    system.debug('lead not converted');
   // System.debug(LoggingLevel.INFO, lcr);
}

 
Hi All,

I want know the about the relationship between Lead, Account with Topics because i need to query those lead or accounts record which have a topic added.
Hi All,

I have a variable of get set type, I am showing this variable value on visualforce page using outputtext tag. Now user wants to edit this outputtext value on double click. I am also using inlineeditsupport tag for achive this but this is not working with ouputtext tag.

Please help me...
Hi,
I am trying simple example of SOQL, to diaplay name of all the accounts, using below statements:-
Account act = [Select name from Account];
for (List <Account> a: act)
{
system.debug('Account Name'+ a);
}
It thorws an error-Loop must iterate over a collection type: Account
What, I am missing here?
Hi,

How to write code when Account updated Contacts will created and as Contact created Opportunity also get created
Hi All,

I want know the about the relationship between Lead, Account with Topics because i need to query those lead or accounts record which have a topic added.

Hi Everyone,

 

 

i need to develope an apex component in such a way that it should create a pageblocktable by taking object name ,fields name dynamically.For this i written a controller but it is not make my need.my approach is i'm trying to retrieve field names from wrapper class,object name dynamically from database.query and i will bind this wrapper to my page block table.
 Can anyone help this scenario with some sample code please guys??
 
Thanks,
bhagi
  • September 10, 2012
  • Like
  • 1