• Priti Shelke
  • NEWBIE
  • 20 Points
  • Member since 2017
  • Salesforce Developer
  • 2πr Consulting

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 7
    Replies
Hi,
I am getting following exception when webservice callout is made.
sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
Can anyone let me know what could be the exact cause of why this error is encountered?

Thanks 
 
Hi Team,
Can I query custom metadata type using SOSL.
I didn't find any document related to query custom metadata using SOSL.

Please confirm me.
Thanks
Hi All,
I am new to live agent and I want to remove some fields from live agent chat layout.
so, is it possible to change live agent chat layout(Which display when chatting start)?

Thanks
 
Hi all,
I have created 2 visual force page, login page and detail page after successful login it will redirect to next detail page. 
Now I have added login page to force.com site but it not redirecting to the detail page(In URL showing page name and record Id correctly).
redirecting to below URL.
'https://employeeloginpage-developer-edition.ap5.force.com/EmployeeDetailPage?id=0037F00000Slwc2QAB'
I have added this page to profile and gives all required access.
Could anyone please guide me as I am not getting any online solution.

Thanks 
Hi All,
I have written the Apex class for coping all feeditem of lead to converted account and Contact.
The code is working fine but it will not work for above 200 records because I have queried feeditem inside the loop.
for(Lead l:ledlst)
    {
        for(List<feeditem> flst:[Select ParentId,Id, Body,IsRichText From FeedItem Where ParentId =: l.id])
        {
          feedMap.put(l.Id, flst); 
        }
    }
As am new to salesforce I not getting how to optimize this code.
Please help me to write code with best practice.
Entire Class Code:
public class Lead_Convert_Handler 
{
 public void addLeadfeedToAccCont(list<Lead> ledlst)
  {
    list<feedItem> conFeeditm = new list<feedItem>();
    list<feedItem> accFeeditm = new list<feedItem>();    
    Map<Id,list<FeedItem>> feedMap = new Map<Id,list<FeedItem>>();    
    Map<Id,Id> acctIdMap = new Map<Id,Id>();
    Map<Id,Id> contIdMap = new Map<Id,Id>();  
    // add feeditem related to lead to FeedMap  
    for(Lead l:ledlst)
    {
        for(List<feeditem> flst:[Select ParentId,Id, Body,IsRichText From FeedItem Where ParentId =: l.id])
        {
          feedMap.put(l.Id, flst); 
        }
    }
   // loop to add converted acc and cont id to map.   
    for(lead l:ledlst)
    {
      acctIdMap.put(l.id, l.ConvertedAccountId);
      contIdMap.put(l.id, l.ConvertedContactId);  
    }
    system.debug(feedMap);  
    // Copy feeditem from lead to converted contact and account.  
    for(lead l1:ledlst)
    {
        if(!feedMap.isEmpty())
        {
            //for(Id pid:feedMap.keySet())
            //{
            for(feedItem lf:feedMap.get(l1.id))
             {
              if(feedMap.containsKey(l1.Id)&&acctIdMap.containsKey(l1.Id)&&contIdMap.containsKey(l1.Id)&&lf.ParentId == l1.Id) 
                {
                  // create feed for Account  
                  FeedItem accfeed = new FeedItem();
                  accfeed.Body = lf.Body;
                  accfeed.ParentId = acctIdMap.get(l1.Id);
                  accFeeditm.add(accfeed);
                // create feed for Contact
                 FeedItem confeed = new FeedItem();
                 confeed.Body = lf.Body;
                 confeed.ParentId =contIdMap.get(l1.Id);
                 conFeeditm.add(confeed);          
                }
              }
          //  }
        } 
    }
    IF(!accFeeditm.isEmpty())
    insert accFeeditm;
    IF(!conFeeditm.isEmpty())
    insert conFeeditm;   
  }
}

Thanks In advance
Hi,
I am getting following exception when webservice callout is made.
sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: validity check failed
Can anyone let me know what could be the exact cause of why this error is encountered?

Thanks 
 
What number of records can be displayed on VisualForce page? How to maximize it?
Hi all,
I have created 2 visual force page, login page and detail page after successful login it will redirect to next detail page. 
Now I have added login page to force.com site but it not redirecting to the detail page(In URL showing page name and record Id correctly).
redirecting to below URL.
'https://employeeloginpage-developer-edition.ap5.force.com/EmployeeDetailPage?id=0037F00000Slwc2QAB'
I have added this page to profile and gives all required access.
Could anyone please guide me as I am not getting any online solution.

Thanks 
Hi All,
I have written the Apex class for coping all feeditem of lead to converted account and Contact.
The code is working fine but it will not work for above 200 records because I have queried feeditem inside the loop.
for(Lead l:ledlst)
    {
        for(List<feeditem> flst:[Select ParentId,Id, Body,IsRichText From FeedItem Where ParentId =: l.id])
        {
          feedMap.put(l.Id, flst); 
        }
    }
As am new to salesforce I not getting how to optimize this code.
Please help me to write code with best practice.
Entire Class Code:
public class Lead_Convert_Handler 
{
 public void addLeadfeedToAccCont(list<Lead> ledlst)
  {
    list<feedItem> conFeeditm = new list<feedItem>();
    list<feedItem> accFeeditm = new list<feedItem>();    
    Map<Id,list<FeedItem>> feedMap = new Map<Id,list<FeedItem>>();    
    Map<Id,Id> acctIdMap = new Map<Id,Id>();
    Map<Id,Id> contIdMap = new Map<Id,Id>();  
    // add feeditem related to lead to FeedMap  
    for(Lead l:ledlst)
    {
        for(List<feeditem> flst:[Select ParentId,Id, Body,IsRichText From FeedItem Where ParentId =: l.id])
        {
          feedMap.put(l.Id, flst); 
        }
    }
   // loop to add converted acc and cont id to map.   
    for(lead l:ledlst)
    {
      acctIdMap.put(l.id, l.ConvertedAccountId);
      contIdMap.put(l.id, l.ConvertedContactId);  
    }
    system.debug(feedMap);  
    // Copy feeditem from lead to converted contact and account.  
    for(lead l1:ledlst)
    {
        if(!feedMap.isEmpty())
        {
            //for(Id pid:feedMap.keySet())
            //{
            for(feedItem lf:feedMap.get(l1.id))
             {
              if(feedMap.containsKey(l1.Id)&&acctIdMap.containsKey(l1.Id)&&contIdMap.containsKey(l1.Id)&&lf.ParentId == l1.Id) 
                {
                  // create feed for Account  
                  FeedItem accfeed = new FeedItem();
                  accfeed.Body = lf.Body;
                  accfeed.ParentId = acctIdMap.get(l1.Id);
                  accFeeditm.add(accfeed);
                // create feed for Contact
                 FeedItem confeed = new FeedItem();
                 confeed.Body = lf.Body;
                 confeed.ParentId =contIdMap.get(l1.Id);
                 conFeeditm.add(confeed);          
                }
              }
          //  }
        } 
    }
    IF(!accFeeditm.isEmpty())
    insert accFeeditm;
    IF(!conFeeditm.isEmpty())
    insert conFeeditm;   
  }
}

Thanks In advance