• Erik John P
  • NEWBIE
  • 50 Points
  • Member since 2016
  • Salesforce Admin
  • Tuff Shed


  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 25
    Replies
hello,
lookinf for some assistance from the dev folks.  I am but a lowly admin :-).  any help is appreciated.
this works Anonymous editor:
String leadId_in = '00Q5B000003JcHYUA0';
String company_in = 'TS00120';
    
    
        String companyIS = company_in; 
        
        // need to return fewer columns
        Lead[] lds = 
            [select Lead.Id, Lead.Geocode_Quality__c, Lead.Geolocation__Latitude__s, 
             Lead.Geolocation__Longitude__s, Lead.Distance_for_Delivery_Charge__c, Lead.Company 
             from Lead where Lead.Id = :leadId_in and Lead.Company = :companyIS
            ];
        
        //debug: leads returned in query
        System.debug('Lead count anonymous: ' + lds.size()); 



this doesn't work in class:

public class FindDeliveryDistance {
    
    
    private Lead[] lds = null; 
    private Location companyLoc = null; 
    private String companyIS = null; 

    
    /**
    * Use lead_id and Company name to select lead data. 
    * 
    */    
    public FindDeliveryDistance(String leadId_in, String company_in){
        
        System.debug('leadId_in: ' + leadId_in); 
        System.debug('company_in: ' + company_in); 

        
        companyIS = company_in; 
        
        // need to return fewer columns
        lds = 
            [select Lead.Id, Lead.Geocode_Quality__c, Lead.Geolocation__Latitude__s, 
             Lead.Geolocation__Longitude__s, Lead.Distance_for_Delivery_Charge__c, Lead.Company 
             from Lead where Lead.Id = :leadId_in and Lead.Company = :companyIS
            ];
        
        //debug: leads returned in query
        System.debug('Lead count: ' + lds.size()); 

    } }

what am I doing wrong?
Hello all, 
in Winter '18, the lead conversion process in Lightning is different.  I'd like to be able to customize this so the "choose existing" button is the default on accounts.  is this possible to anyone's knowledge?
User-added image
Hello all!
I am attempting to switch the default opportunity list view in Lightning from "recent" to "my open opportunities".  I have created a VF page, and adjusted the tab to show the VF page instead of the default.  I think I'm almost there, but 2 issues.
1.  The page displayed is classic with a lightning header.  I would like it to be displayed as a lightning page.
2.  The displayed list is not "my open opportunities".
my VF page code is as follows:
<apex:page showHeader="true" tabstyle="Opportunity">
<apex:ListViews type="Opportunity" />
</apex:page>

any assistance on this is appreciated.
Hello there,  I have a Visualforce page button on my opportunity page in lightning (Winter '17).  it is supposed to link to our ERP system for creating orders.  when I click the link, it simply "blanks" out the page.  I'm left with the menu of objects left to right at the top, but everything below that is blank and it doesn't do to the desired location.  Any help is appreciated!

<apex:page standardController="Opportunity"> <script> http://MAGICDEV/magicxpi4_1/MGrqispi.dll?appname=IFSSF_JDE&prgname=HTTP&arguments=-AJDE_INT%23TS&OppID={!Opportunity.Id} </script> </apex:page>
Hello all,
While at Dreamforce a very helpful developer showed me how to create a VF page, then a button that will display in Lightning.  I took copious notes, and tried to replicate another button I need to display in Lightning.  When I go to page layout and attempt to place the button, it is "not allowed".  I don't appear to have any issues with my APEX.  it is essentially a hyperlink that goes to a different system.  Any assistance is appreciated.

here's the code if that helps:

<apex:page standardController="Opportunity">
    <script>

http://MAGICDEV/magicxpi4_1/MGrqispi.dll?appname=IFSSF_JDE&prgname=HTTP&arguments=-AJDE_INT%23TS&OppID={!Opportunity.Id}

    </script>
</apex:page>
Hello all! 

I feel that I am almost there on an inbound changeset from sandbox to prod.  I am however getting an error that "required fields are missing [Company]; [Company]."   this is the error on 4 test classes, one of which is below.  I'm perplexed because the one below has company in the test class, so not sure why I'm still seeing the error.  on this one at least.

@istest
private class ELQA_Leadconvert_updateTest{
    static testmethod void positivetest() {
        Lead testlead = new Lead();
        testlead.firstname = 'test first';
        testlead.lastname = 'test last';
        testLead.company = 'Test Co';
        testLead.email = 'test@gmail.com';
        TestLead.TS_Factory__c ='TS00020';
                // added all required field here
        insert testlead;
        
        /*Added by Greytrix to emailsToChangeInEloqua part*/
        testLead.email = 'test1@gmail.com';
        update testlead;
        /*Modifications by Greytrix ends*/
        //Start the test 
        test.starttest();
        database.leadconvert testLeadConvert = new database.leadconvert();
        testLeadConvert.setleadID(testlead.id); 
        /*Modifications by Greytrix starts*/
        //set no Opportunity to be created after conversion
        testLeadConvert.setDoNotCreateOpportunity(false);
        //fetch the label for the Converted status for lead, and set the value
        LeadStatus convertStatus = [Select Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
        testLeadConvert.setConvertedStatus(convertStatus.MasterLabel);
        //Convert the lead
        Database.LeadConvertResult lcr = Database.convertLead(testLeadConvert);
        System.assert(lcr.isSuccess());
        /*Modifications by Greytrix ends*/
        //Stop the test
        test.stoptest();
    }
}
Hello,
first off, thanks to the community for getting me this far.  I am attempting to create an outbound change set for a test class that will give me code coverage.  I have the test class and it's giving proper coverage.  however, I am now recieving an error that "changeset requires 38.0 or higher platform version".  is this because I am attempting a changeset from winter '17 sandbox to summer '16 prod?  is there a fix or workaround for this? 
Hello Community,

I do apologize as this is my second contact in less than a week, but we are very close to importing an apex class from sandbox to production, and I am running into a roadblock with some code in production that I did not write.  it needs a test class in order for me to import my apex class.    would anyone be able to provide assistance with writing a test class for a trigger?  trigger is below:

trigger ELQA_LeadConvert_Update_Marketing_Trigger on Lead (after update) 
{

    Set<Id> convertedids = new Set<Id>();
    map<string,string> emailsToChangeInEloqua = new map<string,string>();
    map <Id,Id> leadsAndContacts = new map <Id,Id>();
         for (Lead objLead : Trigger.new)
        {
           lead oldLead = Trigger.oldMap.get(objLead.Id);
           if(oldLead.IsConverted == false && objLead.IsConverted == true)
           {
               convertedids.add(objLead.Id);
               leadsAndContacts.put(objLead.Id,objLead.ConvertedContactId);
           }
           
           if(String.isNotBlank(objLead.email) && String.isNotBlank(oldLead.email) && objLead.email != oldLead .email){
                emailsToChangeInEloqua.put(oldLead.email, objLead.email);
            }
        }
        
         
        
         if(!convertedids.isEmpty()) 
         {
             ELOQUA__Marketing_Activity__c[] objMarketing = [SELECT id, ELOQUA__Lead__c, ELOQUA__Contact__c 
                                                             FROM ELOQUA__Marketing_Activity__c 
                                                             WHERE ELOQUA__Lead__c IN :convertedids];
             if(!objMarketing.isEmpty()) 
             {
                 for(ELOQUA__Marketing_Activity__c obj: objMarketing)
                  {
                      obj.ELOQUA__Contact__c = leadsAndContacts.get(obj.ELOQUA__Lead__c );
                  }
                  
                  update objMarketing;
             }
                                                      
         }
         
         if( emailsToChangeInEloqua.size() > 0 ) {
              ChangeEloquaEmailAddressCls.ChangeEloquaEmailAddress(emailsToChangeInEloqua);
        }
        
        LeadTriggerHandler.afterInsert(Trigger.new,Trigger.oldMap); 
Hello all,
I apologize if this is a repeat, but I am very new to SFDC Apex Code.  I have an apex class in Sandbox that I am trying to migrate to production.  I get the code coverage error (my class currently shows "no coverage" in sandbox).  I am reading about testing, but unsure how it all ties together to create a deployable inbound change set in prod.

the code I have is as follows:
public class AssignLeadsUsingAssignmentRules
{@InvocableMethod     public static void LeadAssign(List<Id> LeadIds)    
{Database.DMLOptions dmo =
new Database.DMLOptions();dmo.assignmentRuleHeader.useDefaultRule= true;
Lead Leads=
[select id from lead where lead.id in :LeadIds]; Leads.setOptions(dmo); update Leads;    } }

again, being new to this, I thought adding "@istest" to the beginning would do the trick.  sounds like it's a little more involved than that?

any help is greatly appreciated.
thank you.
Hello all!
I am attempting to switch the default opportunity list view in Lightning from "recent" to "my open opportunities".  I have created a VF page, and adjusted the tab to show the VF page instead of the default.  I think I'm almost there, but 2 issues.
1.  The page displayed is classic with a lightning header.  I would like it to be displayed as a lightning page.
2.  The displayed list is not "my open opportunities".
my VF page code is as follows:
<apex:page showHeader="true" tabstyle="Opportunity">
<apex:ListViews type="Opportunity" />
</apex:page>

any assistance on this is appreciated.
hello,
lookinf for some assistance from the dev folks.  I am but a lowly admin :-).  any help is appreciated.
this works Anonymous editor:
String leadId_in = '00Q5B000003JcHYUA0';
String company_in = 'TS00120';
    
    
        String companyIS = company_in; 
        
        // need to return fewer columns
        Lead[] lds = 
            [select Lead.Id, Lead.Geocode_Quality__c, Lead.Geolocation__Latitude__s, 
             Lead.Geolocation__Longitude__s, Lead.Distance_for_Delivery_Charge__c, Lead.Company 
             from Lead where Lead.Id = :leadId_in and Lead.Company = :companyIS
            ];
        
        //debug: leads returned in query
        System.debug('Lead count anonymous: ' + lds.size()); 



this doesn't work in class:

public class FindDeliveryDistance {
    
    
    private Lead[] lds = null; 
    private Location companyLoc = null; 
    private String companyIS = null; 

    
    /**
    * Use lead_id and Company name to select lead data. 
    * 
    */    
    public FindDeliveryDistance(String leadId_in, String company_in){
        
        System.debug('leadId_in: ' + leadId_in); 
        System.debug('company_in: ' + company_in); 

        
        companyIS = company_in; 
        
        // need to return fewer columns
        lds = 
            [select Lead.Id, Lead.Geocode_Quality__c, Lead.Geolocation__Latitude__s, 
             Lead.Geolocation__Longitude__s, Lead.Distance_for_Delivery_Charge__c, Lead.Company 
             from Lead where Lead.Id = :leadId_in and Lead.Company = :companyIS
            ];
        
        //debug: leads returned in query
        System.debug('Lead count: ' + lds.size()); 

    } }

what am I doing wrong?
Hello all, 
in Winter '18, the lead conversion process in Lightning is different.  I'd like to be able to customize this so the "choose existing" button is the default on accounts.  is this possible to anyone's knowledge?
User-added image
Hello all!
I am attempting to switch the default opportunity list view in Lightning from "recent" to "my open opportunities".  I have created a VF page, and adjusted the tab to show the VF page instead of the default.  I think I'm almost there, but 2 issues.
1.  The page displayed is classic with a lightning header.  I would like it to be displayed as a lightning page.
2.  The displayed list is not "my open opportunities".
my VF page code is as follows:
<apex:page showHeader="true" tabstyle="Opportunity">
<apex:ListViews type="Opportunity" />
</apex:page>

any assistance on this is appreciated.
Hello there,  I have a Visualforce page button on my opportunity page in lightning (Winter '17).  it is supposed to link to our ERP system for creating orders.  when I click the link, it simply "blanks" out the page.  I'm left with the menu of objects left to right at the top, but everything below that is blank and it doesn't do to the desired location.  Any help is appreciated!

<apex:page standardController="Opportunity"> <script> http://MAGICDEV/magicxpi4_1/MGrqispi.dll?appname=IFSSF_JDE&prgname=HTTP&arguments=-AJDE_INT%23TS&OppID={!Opportunity.Id} </script> </apex:page>
Hello all,
While at Dreamforce a very helpful developer showed me how to create a VF page, then a button that will display in Lightning.  I took copious notes, and tried to replicate another button I need to display in Lightning.  When I go to page layout and attempt to place the button, it is "not allowed".  I don't appear to have any issues with my APEX.  it is essentially a hyperlink that goes to a different system.  Any assistance is appreciated.

here's the code if that helps:

<apex:page standardController="Opportunity">
    <script>

http://MAGICDEV/magicxpi4_1/MGrqispi.dll?appname=IFSSF_JDE&prgname=HTTP&arguments=-AJDE_INT%23TS&OppID={!Opportunity.Id}

    </script>
</apex:page>
Hello all! 

I feel that I am almost there on an inbound changeset from sandbox to prod.  I am however getting an error that "required fields are missing [Company]; [Company]."   this is the error on 4 test classes, one of which is below.  I'm perplexed because the one below has company in the test class, so not sure why I'm still seeing the error.  on this one at least.

@istest
private class ELQA_Leadconvert_updateTest{
    static testmethod void positivetest() {
        Lead testlead = new Lead();
        testlead.firstname = 'test first';
        testlead.lastname = 'test last';
        testLead.company = 'Test Co';
        testLead.email = 'test@gmail.com';
        TestLead.TS_Factory__c ='TS00020';
                // added all required field here
        insert testlead;
        
        /*Added by Greytrix to emailsToChangeInEloqua part*/
        testLead.email = 'test1@gmail.com';
        update testlead;
        /*Modifications by Greytrix ends*/
        //Start the test 
        test.starttest();
        database.leadconvert testLeadConvert = new database.leadconvert();
        testLeadConvert.setleadID(testlead.id); 
        /*Modifications by Greytrix starts*/
        //set no Opportunity to be created after conversion
        testLeadConvert.setDoNotCreateOpportunity(false);
        //fetch the label for the Converted status for lead, and set the value
        LeadStatus convertStatus = [Select Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
        testLeadConvert.setConvertedStatus(convertStatus.MasterLabel);
        //Convert the lead
        Database.LeadConvertResult lcr = Database.convertLead(testLeadConvert);
        System.assert(lcr.isSuccess());
        /*Modifications by Greytrix ends*/
        //Stop the test
        test.stoptest();
    }
}
Hello,
first off, thanks to the community for getting me this far.  I am attempting to create an outbound change set for a test class that will give me code coverage.  I have the test class and it's giving proper coverage.  however, I am now recieving an error that "changeset requires 38.0 or higher platform version".  is this because I am attempting a changeset from winter '17 sandbox to summer '16 prod?  is there a fix or workaround for this? 
Hello all,
I apologize if this is a repeat, but I am very new to SFDC Apex Code.  I have an apex class in Sandbox that I am trying to migrate to production.  I get the code coverage error (my class currently shows "no coverage" in sandbox).  I am reading about testing, but unsure how it all ties together to create a deployable inbound change set in prod.

the code I have is as follows:
public class AssignLeadsUsingAssignmentRules
{@InvocableMethod     public static void LeadAssign(List<Id> LeadIds)    
{Database.DMLOptions dmo =
new Database.DMLOptions();dmo.assignmentRuleHeader.useDefaultRule= true;
Lead Leads=
[select id from lead where lead.id in :LeadIds]; Leads.setOptions(dmo); update Leads;    } }

again, being new to this, I thought adding "@istest" to the beginning would do the trick.  sounds like it's a little more involved than that?

any help is greatly appreciated.
thank you.
I am using trigger to auto conversion lead to opportunity, Please advise is there is any possibility do without trigger code.