• Jeremy.Nottingh
  • SMARTIE
  • 825 Points
  • Member since 2008

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

I have a fairly simple selectoption that I use on a VF page. How do I create a unit test for it:

 

 

   public List<SelectOption> getLocationItems() {

    List<SelectOption> options = new List<SelectOption>();

       options.add(new SelectOption('On-Phone','On-Phone'));

       options.add(new SelectOption('In-Person','In-Person'));

       return options;

   }

 

 

   public List<SelectOption> getAE_LocationItems() {
    List<SelectOption> options = new List<SelectOption>();
       options.add(new SelectOption('On-Phone','On-Phone'));
       options.add(new SelectOption('In-Person','In-Person'));
       return options;
   }public List<SelectOption> getAE_LocationItems() {     List<SelectOption> options = new List<SelectOption>();        options.add(new SelectOption('On-Phone','On-Phone'));        options.add(new SelectOption('In-Person','In-Person'));        return options;    }

 

I don't understand how this limit works. I have three active triggers (all on tasks), all contains some queries.

I'd like to create some new triggers on opportunities and lineItems but no matters how simple my code is, I always get the query limit error.

What could I make wrong? My triggers doesn't come from any other trigger, so the queries cannot sum up

 

thanks for the answers

hi i was just practicing SOQL queries and i wrote a test query in apex explorer

 

 

Select Id, Name, Industry,Company_Relationship__c From Account where Company_Relationship__c='Employee' and Lead_Created_Date__c=System.today()

 

 

and when i tried to execute i am getting an error can anyone tell me where my error is.

 

error: unexpected token 'system.today()'

I have limited (very) programming knowledge and need some help with a trigger so any assistance would be greatly appreciated. 

 

I have 2 custom objects which are part of a managed package(Docusign for salesforce).

How it works is you click "Send" from a Contact and it opens a new window called an envelope [dsfs__DocuSign_Envelope__c] which is a master object with the contact listed as a recipient  [dsfs__DocuSign_Envelope_Recipient__c] which is the child object

 

 

I would like to add an additional standard recipient every time "send" is launched. I did attempt to create a trigger which is listed below but this doesn't work. Please be gentle with your criticism as i'm humiliatated even posting it but here goes;

 

trigger dse on dsfs__DocuSign_Envelope_Recipient__c (after insert) {
    List<dsfs__DocuSign_Envelope_Recipient__c> dser = new List<dsfs__DocuSign_Envelope_Recipient__c>();
    //For each envelope processed by the trigger, add a new  recipient
    for (dsfs__DocuSign_Envelope_Recipient__c newdser: Trigger.New) {
            dser.add(new dsfs__DocuSign_Envelope_Recipient__c(
                        dsfs__DocuSign_Signer_Type__c ='Carbon Copy',
                        dsfs__DSER_ContactID__c = '003Q000000BhWpP'));
        }
}

 

 

 

Hello Once Again All,

 

I am really struggling with trying to understand how to get around these exhausting limits!  I have over 16,000 records as of today that are in production/sandbox.  I need to iterate through them all and this number is going to grow.  How can I manipulate the code below to get around the limits.  I just am not getting these work around requirements yet.  I will but I am just a little slow on catch the ball sometimes.  I appreciate your support.

 

This code is all around another post that I submitted on how to produce a report that shows Opportunities that have no related Opportunity Partner Records.  The work around was to add a custom checkbox field on the opportunity object and use apex to check it no parters exist and uncheck it if one or more does exists.  The code below a small portion of this.  If I am this thing working I would like to post the enter class code in here for others because I saw this question by others.

 

opps = [ select id, MissingPartner__c, (select id from OpportunityPartnersFrom) 
                                      from Opportunity ];
        }                        
                                  
        for (Opportunity o : opps) {            
            if ( o.OpportunityPartnersFrom.size() > 0 ) {
                o.MissingPartner__c = false;    //Opportunity has partner record(s)
                
            } else {                                        
                o.MissingPartner__c = true;     //Opportunity is missing partner record(s)            
            }                
        }

 

 

 

 

The hierarchy of objects for this problem is Account - Contract - Invoice - Shipment.  
Contract is detail to master with account,
Invoice is detail to master with contract and lookup with account. and
Shipment is detail to master with invoice and lookup with both contract and account.  

The code below  populates the account field on the shipment record when the shipment record is created for the first time.  The problem that I am trying to solve is how to populate the contract field also at the same time that the account field is populated because currently I have to enter the contract number manually even though the shipment record belongs to one and only one contract through the invoice record.

/*Salesforce.com Extension Doug copied OLI_Serial_Number Trigger
This trigger is used to populate Account field on Shipment__c custom object
*/
trigger updateShipmentInfo on Shipment__c (before insert) {

    Set<Id> shipIds=new Set<Id>();
    Set<Id> conIds=new Set<Id>();
    
    for(Shipment__c ship:Trigger.new){
        shipIds.add(ship.Id);
        conIds.add(ship.contract__c);
    }
    
    if(shipIds.size() > 0){
    Map<Id,Contract> conMap = new Map<Id,Contract>([select AccountId from contract where id in:conIds]);
    
        for(Shipment__c ship:Trigger.new){
            ship.put(Shipment__c.Account__c, conMap.get(ship.contract__c).accountId);
        }
    }
}

 

Any help will be much appreciated!

 

Thanks

 

Doug

Hello,

 

I'm new to Apex coding and was wondering how a VF page would look for creating a button that would export data in an opportunity.   I'm trying to give my users the ability to hit the button in an opportunity and export company name, address, sales order # into a Network Access Database or an Excel Spreadsheet.  We'll use this database to create call tags via UPS to return an order (completed Opportunity). 

 

Sean

Hi,

 

Have a visualforce page rendered as a PDF.

 

I now want to batch produce if possible PDF's.

 

Is this possible?

 

Thanks

 

Ross

Would like to extend the capability of the "View All" button under the Activity History section to only return activities assigned to certain users.

 

Where can I get the source code for the View Activity History? 

 

How would I go about creating the filter?

 

I've developed using Apex but I am new to VF.

 

-Thanks

I want to display the header for a visual force page.  I put showHeader="true"  in the "<apex:page" line, but the header does not show unless I have a "<apex:detail/>" item on the page.

 

I know the name of the object row and want that displayed in the header, but I want to format the rest of the page without using the detail view.

 

Is there anyway that this can be done?

 

Thanks,

JR

Hello all,

 

I checked out the forums and I can't seem to find a solution to this. On person accounts (in Enterprise Edition), I have an auto-number field but I only want increment for my "customers" record type and not my "employee" record type. Right now it is auto-numbering for both even though I want it to increment when it's the customer record type.  Can someone help me with this/point me into the right direction or have some custom code that can do this?

 

Thanks much!

-Billy

I have two fields..

 

1- Date_Time_1_c

2- Date_Time_2_c

 

I want the default value of Date_time_2_c to be Date_Time_1_c+1 hour. How do I use addhours here? or is there any other solution?

 

Thanks,

Shariq

Hi,

 

I have made a visualforce page which displays a table of data. I have also put some filters there for which the number of rows of the data in the visualforce page varies.

 

Now I want a mechanism in place by which I can export the data showing at a partcular moment can be exported to a excel sheet/csv with column headers which can be saved locally.

 

a help and a guideline will be much appreciated.

 

cheers

 

Praz