• Bernie X
  • NEWBIE
  • 0 Points
  • Member since 2014
  • Occasional Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
I'd like to have a button send an e-mail, after an onclick.  I've setup my OrgWideEmailAddress in my sandbox, and can access its ID via SOQL query.  Using the an embedded sendemail API call in Javascript, I get the following error {faultcode:'soapenv:Client', faultstring:'Element {urn:partner.soap.sforce.com}OrgWideEmailAddressId invalid at this location', }.  Can't figure out even what this error means...this location?
I have been struggling to understand why code coverage for a trigger is 100% in sandbox and 0% when attempting to deploy to production.
Here's a class method I've wriiten to dynamically create new custom records from two independet SOQL queries.  The code works without any hitches, but I can't understand why only r.Part__c=whatlist[0].id works inside the inner for loop.  No matter the size of whatlist, r.Part__c=whatlist[i].id generates an out of bounds error.  Only r.Part__c=whatlist[0].id allows for the intended iteration.

public list <system__c> GetQuoteData(string s){
    mylist =[select quoteid,quantity,discount,PricebookEntry.Product2Id,PricebookEntry.Productcode from quotelineitem where quoteid=:s
             and (/*not*/PricebookEntry.Productcode like '700-%')];
        for (integer v=0;v<mylist.size();v++){
          
     
            system__c r = new system__c();
            r.qty__c=mylist[v].quantity;
            r.discount__c=mylist[v].discount;
       
       
        
        whatlist=[select id,Product2id_map__c from part__c where Product2id_map__c=:mylist[v].PricebookEntry.Product2Id];
        for(integer i=0;i<whatlist.size();i++){ //system__c f = new system__c();
            r.Part__c=whatlist[0].id;
            system.debug('||||||||||||'+mylist.size());
            system.debug('||||||||||||'+whatlist[0]);
         
        }
            dumblist.add(r);
            system.debug('####'+dumblist[v].qty__c+'####'+dumblist[v].part__c+'####'+dumblist[v].discount__c);
           
        }
I'd like to have a button send an e-mail, after an onclick.  I've setup my OrgWideEmailAddress in my sandbox, and can access its ID via SOQL query.  Using the an embedded sendemail API call in Javascript, I get the following error {faultcode:'soapenv:Client', faultstring:'Element {urn:partner.soap.sforce.com}OrgWideEmailAddressId invalid at this location', }.  Can't figure out even what this error means...this location?
I have been struggling to understand why code coverage for a trigger is 100% in sandbox and 0% when attempting to deploy to production.
Here's a class method I've wriiten to dynamically create new custom records from two independet SOQL queries.  The code works without any hitches, but I can't understand why only r.Part__c=whatlist[0].id works inside the inner for loop.  No matter the size of whatlist, r.Part__c=whatlist[i].id generates an out of bounds error.  Only r.Part__c=whatlist[0].id allows for the intended iteration.

public list <system__c> GetQuoteData(string s){
    mylist =[select quoteid,quantity,discount,PricebookEntry.Product2Id,PricebookEntry.Productcode from quotelineitem where quoteid=:s
             and (/*not*/PricebookEntry.Productcode like '700-%')];
        for (integer v=0;v<mylist.size();v++){
          
     
            system__c r = new system__c();
            r.qty__c=mylist[v].quantity;
            r.discount__c=mylist[v].discount;
       
       
        
        whatlist=[select id,Product2id_map__c from part__c where Product2id_map__c=:mylist[v].PricebookEntry.Product2Id];
        for(integer i=0;i<whatlist.size();i++){ //system__c f = new system__c();
            r.Part__c=whatlist[0].id;
            system.debug('||||||||||||'+mylist.size());
            system.debug('||||||||||||'+whatlist[0]);
         
        }
            dumblist.add(r);
            system.debug('####'+dumblist[v].qty__c+'####'+dumblist[v].part__c+'####'+dumblist[v].discount__c);
           
        }