• Mohammad
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 6
    Replies

Hi All, I am a newbie to salesforce. my problem is : I am inserting a new Lead Source that is a related list of Lead. In my Lead Source object
there are two lookups, one on Contact and the other on Lead. When I insert a new Lead Source (by giving the Lead and Contact names in the
Lead Source object, one more Lead Source should be inserted (with the same Lead name and a Contact name that is present on the first selected Contact as a look up
on Contact). I am using after insert to insert this second Lead Source. In before insert i had used @future because of governer limits and i am using
@future in my class that is called by my after insert trigger. i am using a flag to prevent execution of before insert second time. but i think, i am not able to prevent it
from execution as it gives an error "future method can not be called from a future method:methodName()". How can i check this. pls help.

Can anybody help me figure out why the following 2 soql queries seem to take forever...they timeout in the workbench. Do you see anything I could to imporve their performance? Thanks!

 

Select Contact__c,ISBN_13__c,Order_Date__c,Id,Ship_Date__c,Ship_Method_Description__c,Contact__r.Email,Product__r.Name From Comp_Item__c where (LastModifiedDate >=2013-04-07T20:50:40.9793994Z or CreatedDate <=2013-04-07T20:50:40.9793994Z) and Contact__r.Email like '%@%' and Contact__c != Null And (NOT Contact__r.Email like '%@wiley.com') and Contact__r.Inactive__c = FALSE

 

Select ContactId,Id,OpportunityId,Contact.Email,Opportunity.BRV__c,Opportunity.CA_Tier__c,Opportunity.Custom__c,Opportunity.CloseDate,Opportunity.Enrolment__c,Opportunity.MarketConsultant__c,Opportunity.Type,Opportunity.OwnerId,Opportunity.Primary_Long_Title__c,Opportunity.Primary_Title_Author__c,Opportunity.PrimaryTitleCourseCodeNum__c,Opportunity.Primary_Title_ISBN_13__c,Opportunity.Priority_Target__c,Opportunity.Renew__c,Opportunity.Semester__c,Opportunity.StageName,Opportunity.Est_Revenue__c,Opportunity.Tier__c,Opportunity.WileyPLUS__c,Opportunity.Year__c From OpportunityContactRole where ((OpportunityContactRole.LastModifiedDate >=2013-04-07T20:51:55.6877994Z or CreatedDate <=2013-04-07T20:51:55.6877994Z) or (Opportunity.LastModifiedDate >=2013-04-07T20:51:55.6877994Z) or (Contact.LastModifiedDate >=2013-04-07T20:51:55.6877994Z)) and (Contact.Email like '%@%' and (NOT Contact.Email like '%@wiley.com') and Contact.Inactive__c = FALSE)

 

I have a custom close button for our custom object Change.  You click the Close Change button and it opens an edit screen of the closed page layout.  If a user clicks Cancel instead of Save, the changes still take place.  How do I prevent the changes from happening if the users changes their mind and clicks Cancel?

 

Code:

public class CloseChangeButtonController {

    Change__c currChange;

    public CloseChangeButtonController(ApexPages.StandardController controller) {
        currChange = [Select Auto_Approved__c, Contact_Approved_Date_Time__c, Contact_Accepted__c, Change_Owner__c, Category__c, 
        Change_Manager_Rejected_Date_Time__c, Change_Manager_Rejected_Checkbox__c, 
        Change_Manager_Approved_Date_Time__c, Change_Manager_Accepted__c, Change_Implementer__c, Change_Manager__c, 
        Account_Lookup__c, Backout_Plan1__c, Implementation_End_Date_Time__c, Contact_Approver2__c, Dealer_Account4__c, 
        ProductChange__c, UrgencyChange__c, TypeChange__c, Implementation_Plan1__c, Test_Plan1__c, Target_Date_Time__c, 
        Subsystem__c, Subject__c, Implementation_Start_Date_Time__c, Description__c, Dealer_Rejected_Date_Time__c,  
        Dealer_Approver_Rejected_Comments__c, Dealer_Accepted__c, Dealer_Rejected_Checkbox__c, 
        Dealer_Approved_Date_Time__c, Contact_Rejected_Date_Time__c, Contact_Approver_Rejected_Comments__c, Contact_Phone__c, 
        Contact_Rejected_Checkbox__c, Contact_Mobile__c, Contact_Email__c, Support_Advocate1__c From Change__c Where Id = :controller.getId()];
    }
    
    public PageReference CloseChange(){
    
        if((currChange.Auto_Approved__c) || 
        (((currChange.Change_Manager_Accepted__c) || (currChange.Change_Manager_Rejected_Checkbox__c)) && 
        ((currChange.Contact_Accepted__c) || (currChange.Contact_Rejected_Checkbox__c))&&
        ((currChange.Dealer_Accepted__c) || (currChange.Dealer_Rejected_Checkbox__c))))
        {
        currChange.StatusChange__c = 'Completed';       
        currChange.RecordTypeId = '012f00000008WBb';
        // Insert the change record 
        Database.update(currChange);
        PageReference retPage = new PageReference('/' + currChange.id + '/e');
        return retPage;
             
        }
        else{
      PageReference retPage = new PageReference('/' + currChange.id);
        return retPage;
         }
             
      
    }
    
    

}

 

  • April 10, 2013
  • Like
  • 0

Hello,

 

I am having a strange issue with package uploading. It's stuck when uploading a new version for my package. (Of course, I have been able to upload several previous versions before.) This doesn't seem to be test case issue either. The message just says: uploading files, running apex test 311 out of 375.

 

It just stops there and stuck for hours.

 

Please help if you had similar issue before? Much appreciated.

  • April 10, 2013
  • Like
  • 0

Hi All, I am a newbie to salesforce. my problem is : I am inserting a new Lead Source that is a related list of Lead. In my Lead Source object
there are two lookups, one on Contact and the other on Lead. When I insert a new Lead Source (by giving the Lead and Contact names in the
Lead Source object, one more Lead Source should be inserted (with the same Lead name and a Contact name that is present on the first selected Contact as a look up
on Contact). I am using after insert to insert this second Lead Source. In before insert i had used @future because of governer limits and i am using
@future in my class that is called by my after insert trigger. i am using a flag to prevent execution of before insert second time. but i think, i am not able to prevent it
from execution as it gives an error "future method can not be called from a future method:methodName()". How can i check this. pls help.

hi Guys,

We created our own SOAP API for talking to Sforce. Everything works fine, except for one or two "random" errors once in a while. One of these is following html we recieve in response:

The URL contains escaped bytes unsupported by the UTF-8 encoding.

generated by Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)

Can somebody help here?

Message Edited by dinagrover on 09-27-2005 06:34 AM