• cFang
  • NEWBIE
  • 0 Points
  • Member since 2011

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

I have a new client that currently uses Salesforce.com Enterprise edition but is really only using the Accounts, Contacts, and Opportunities objects. All other objects they use are custom objects. I don't forsee them adopting any of the salesforce.com default objects fields (quotes, products, etc.) but they do enjoy using a number of workflows and approvals. Should it be a no brainer decision for me to just switch them to force.com enterprise and then create a custom opportunities object to replace the standard salesforce.com opportunities object?

 

I want to do this because force.com enterprise is considerably cheaper than salesforce.com enterprise and the client is currently not utilizing all of the features of salesforce.com enterprise. I am worried that I am missing something big that I would lose (outside of the default salesforce.com objects) by switching to force.com enterprise. Could anyone clarify if there are any significant changes that occur when switching from Salesforce.com Enterprise to Force.com Enterprise other than the use of the Salesforce.com objects?

  • March 26, 2012
  • Like
  • 0

The code below is setup to automatically create projects for all opportunities that reach a probability of >=90%. I am new to APEX coding and would like to add additional statements that would only allow 1 project for each opportunity. Right now, if an opportunity is updated from 90% to 100% an additional project would be created. What is the best way to limit the code so that only 1 project is created for each opportunity regardless of how many times the probability is updated?

 

Any help is greatly appreciated.

 

This is the code:

 

trigger Locate_Prob90_Opportunities on Opportunity (after update,after insert) {
	
	list<Opportunity> p90opps =
	[select probability
	from opportunity
	where probability >=90
	for update];
	
	for (opportunity oppz: p90opps){
		if(oppz.probability>=90){
			SFDC_project__c prject = new SFDC_Project__c(name='Acme test',opportunity__c=oppz.id);
	
			insert prject;
		
		}
	}
	
	
}

 

 

  • December 20, 2011
  • Like
  • 0

I have a custom related list that I have setup with the APEX page code below. The problem is that the custom related list does not include hyperlinks to the related items. In this case, I have created a custom list that displays opportunities that are associated with the same account as the contact is. The problem is that a user cannot click the associated opportunity and navigate to that page. What do I need to add to get hyper link functionality? Any help is greatly appreciated.

 

<apex:page standardController="Contact" 
extensions="sampleDetailPageCon">
<style>
.fewerMore { display: none;}
</style>
<apex:form > 
 <apex:pageMessages /> 
 <apex:detail relatedList="true"></apex:detail>
 <apex:pageblock id="CustomList" title="Related Opportunities"  >   
     <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}">
             <apex:column value="{!o.Name}"/>        
             <apex:column value="{!o.Account.Name}"/>        
             <apex:column value="{!o.Type}"/>       
             <apex:column value="{!o.Service_MRR__c}"></apex:column>       
             <apex:column value="{!o.CloseDate}"/>   
          </apex:pageBlockTable>   
          <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel> 
      </apex:pageblock>
   </apex:form>
</apex:page>

 

  • December 15, 2011
  • Like
  • 0

I am having difficulties getting >=75% code coverage on the following APEX code.

public class sampleDetailPageCon {    
    private List<Opportunity> oppz;    
    private Contact cntact;    
    public sampleDetailPageCon(ApexPages.StandardController controller) {        
        this.cntact= (Contact)controller.getRecord();    }    
    public List<Opportunity> getOppz()    {        
        Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];        
        if (con.Account == null)         
        return null;        
        oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];        
        return oppz;    
    }
}

The bold section is the section that I cannot get code coverage on. Does anyone have any suggestions on how to test it?

I appreciate any assistance.
  • December 15, 2011
  • Like
  • 0

I have a custom related list that I have setup with the APEX page code below. The problem is that the custom related list does not include hyperlinks to the related items. In this case, I have created a custom list that displays opportunities that are associated with the same account as the contact is. The problem is that a user cannot click the associated opportunity and navigate to that page. What do I need to add to get hyper link functionality? Any help is greatly appreciated.

 

<apex:page standardController="Contact" 
extensions="sampleDetailPageCon">
<style>
.fewerMore { display: none;}
</style>
<apex:form > 
 <apex:pageMessages /> 
 <apex:detail relatedList="true"></apex:detail>
 <apex:pageblock id="CustomList" title="Related Opportunities"  >   
     <apex:pageBlockTable value="{!oppz}" var="o" rendered="{!NOT(ISNULL(oppz))}">
             <apex:column value="{!o.Name}"/>        
             <apex:column value="{!o.Account.Name}"/>        
             <apex:column value="{!o.Type}"/>       
             <apex:column value="{!o.Service_MRR__c}"></apex:column>       
             <apex:column value="{!o.CloseDate}"/>   
          </apex:pageBlockTable>   
          <apex:outputLabel value="No records to display" rendered="{!(ISNULL(oppz))}" styleClass="noRowsHeader"></apex:outputLabel> 
      </apex:pageblock>
   </apex:form>
</apex:page>

 

  • December 15, 2011
  • Like
  • 0

I am having difficulties getting >=75% code coverage on the following APEX code.

public class sampleDetailPageCon {    
    private List<Opportunity> oppz;    
    private Contact cntact;    
    public sampleDetailPageCon(ApexPages.StandardController controller) {        
        this.cntact= (Contact)controller.getRecord();    }    
    public List<Opportunity> getOppz()    {        
        Contact con = [Select id, Account.id FROM Contact where id = :cntact.id];        
        if (con.Account == null)         
        return null;        
        oppz = [Select id, Name, Account.Name, CloseDate, Amount, Type from Opportunity where Account.id = :con.Account.id];        
        return oppz;    
    }
}

The bold section is the section that I cannot get code coverage on. Does anyone have any suggestions on how to test it?

I appreciate any assistance.
  • December 15, 2011
  • Like
  • 0