• Navneet k
  • NEWBIE
  • 0 Points
  • Member since 2015
  • Salesforce Consultant


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies
Hi,

Anyone here who used Apex Continuations(Asynchronous Callouts) for Paypal payments, it takes around 30 seconds in pick-hours for paypal call through Continuation to callback method. Any idea how to reduce this or which one taking more time Paypal or Continuation?

Thanx!
Any App or tool to get real time page view in Salesforce, for counting community/site page views? Please advise! Thanx
Experiencing code coverage issues in production, everything seems good two weeks earlier!
Test class ran successfully, all methods passed but still showing 0% coverage in classes???
Any idea or work around to resolve issue except dividing test class in small pieces?
Hi friends
I have just started working on soap api.
I have 2 salesforce accounts i.e flipkart(source) and hdfc(destination).
The requirement is when an account record is created in flipkart, the same account  name will get created in HDFC along with a new contact which will be associated with new account.

I have generated & uploaded the wsdl fiels respectively and set the respective end points.

The issue is when I call the code from anonymous block in flipkart side it throws "System.CalloutException: You have uncommitted work pending" exception, I read the documentation but I am afraid I do not have any knowledge on how to go about it.
Please help me out.

Code In HDFC account:
global class SoapDemo1
{
   webservice static void CreateContact(String accName,ID accountID)
   {
     Account a=new Account();
     a.Name=accName;
     
     Database.Insert(a);
     
     //create contact
     Contact con=new Contact();
     con.LastName='LName1';
     con.AccountID=accountID;
     con.Account.Name=accName;
     
     Database.Insert(con);
   }
}
Code in flipkart account:  (Below code is written in anonymous block)
Account acc=new Account();
acc.Name='SoapDemo1';
insert(acc);

P2.soap part = new p2.soap();    

p2.LoginResult lr = part.login('hdfcBank@sfdc.com','ecom2B07O2OcHcXhN4kLd83M5eiAulN4'); 

Generated_From_WSDL.SoapDemo1 obj1 = new Generated_From_WSDL.SoapDemo1(); 
   
obj1.sessionHeader = new Generated_From_WSDL.SessionHeader_element();
    
obj1.sessionHeader.sessionId = lr.SessionId;           
    
obj1.CreateContact(acc.Name,acc.ID);
well, I hope I am clear.

Thanks
Pooja biswas


 
Any App or tool to get real time page view in Salesforce, for counting community/site page views? Please advise! Thanx

Hi,

I want to update leads based on criteria once after the contact is insereted. This trigger is not working for my bulk inserts or updates. Am getting error 'System.LimitException: Too many SOQL queries: 101'. Can anyone help me out ?
There is other trigger on leads which will tag the contact details on lead object fields when lead is inserted or updated.
I suppose to deliver this by this friday, Very Urgent.


Trigger updateLeads1 on Contact (after insert, after update) {

Id rtID= [select Id,name from RecordType where name ='APAC - Open' limit 1].Id;

        for(Contact myContact : Trigger.new){
            if(myContact.email != null && myContact.FirstName != null && myContact.LastName != null) {
              for(Lead checkLead : [Select Id, FirstName, LastName, Email, Status, Ready_to_Convert__c, Country_code__c FROM Lead where RecordTypeId = :rtId AND Email = :myContact.Email AND FirstName = :myContact.FirstName AND LastName = :myContact.LastName limit 1]){
                    if(myContact.Turnover__c > 0.00){
                    updatelead(checkLead.id);
                }
             if((myContact.Turnover__c <= 0.00 || myContact.Turnover__c== null) && (checkLead.Country_code__c != 'India' || checkLead.Country_code__c != 'China' || checkLead.Country_code__c != 'Taiwan' || checkLead.Country_code__c != 'Hong Kong')){
                    updatelead1(checkLead.id);
                    }
                }
          }
    }
    
    public static void updatelead(Id leadId) {
    System.debug('Lead ID : '+ leadId);
    lead ld = [SELECT id FROM lead WHERE ID = :leadId];
    system.debug('Lead ID in Query :'+ld);
    ld.Status = 'Order Placed';
    ld.Ready_to_Convert__c = TRUE;
    try {
        update ld;             
        } catch(DMLException e) {   
        System.debug('The following exception has occurred: ' + e.getMessage()); 
        }
}

    public static void updatelead1(Id leadId) {
    System.debug('Lead ID : '+ leadId);
    lead ld = [SELECT id FROM lead WHERE ID = :leadId];
    system.debug('Lead ID in Query :'+ld);
    ld.Status = 'Account created';
    try {
        update ld;             
        } catch(DMLException e) {   
        System.debug('The following exception has occurred: ' + e.getMessage()); 
        }
    }
}

Regards,
Pranav

Test Class
@isTest
Public Class AddRowControllerTest{
Static testmethod void Addrow(){
List<Contact>con=new List<Contact>();
Contact c=new contact();
c.firstname='Test';
c.lastname='Test';
Con.add(c);
insert con;
System.AssertEquals(c.firstname,'Test');
System.AssertEquals(c.lastname,'Test');
system.test.startTest();
AddRowController arc=new AddRowController();
arc.AddRowController(con);
arc.AddRow(con);
System.test.stopTest();

}
}

Apex Class.
public class AddRowController {

Public Contact contact{get;set;}
Public list<Contact> listContact{get;set;}

Public AddRowController(){
Contact contact=new Contact();
List<Contact>listContact=new list<Contact>();
listContact.add(contact);

}
Public  void AddRow(){
Contact con=new Contact();
listContact.add(con);
}

public PageReference saveContact() {
for(Integer i=0; i<listContact.size(); i++)
{
insert listContact;
}
return Page.Properties;
}
}
.In test class without 2 methods addRowController() and addRow() am getting 28%code coverage bt if i included these two methods am getting error like Method does not exist or incorrect signature.
Note:I dont have any other class with name "Test".

can anyone tell me what might be the reason for this error in test class.


Thanks
Experiencing code coverage issues in production, everything seems good two weeks earlier!
Test class ran successfully, all methods passed but still showing 0% coverage in classes???
Any idea or work around to resolve issue except dividing test class in small pieces?
Hi,

We have developed an application using Visualforce pages, components and Apex. The functionality works perfectly fine in Sandbox without any issues, but it fails OCCASIONALLY in Production.
 
Typically I receive following errors

core.apexpages.exceptions.ApexPagesHandledException: Object type not accessible. Please check permissions and make sure the object is not in development mode: Your query request was running for too long.

&

Time Limit exceeded...!

As mentioned before, these errors appear on a random basis on the first load. You can say once or twice a day. These errors have never appeared in Sandbox. The query has been restricted to fetch only 2000 records.

There is no error information in debug logs as well.

We have even refreshed the Sandbox (FULL) to find the reason, but it runs perfectly without any issue in Sandbox.

Any direction to solve this problem?

Regards,
Pranav