• Mike McNeeley 8
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 19
    Replies
Best practice question... I'm writing a Trigger on after update, after delete. Should I place the DML statement in the Class method the Trigger is calling or within the Trigger itself?
I desperately want a way to search through our Org's metadata so I can clean things up. I've successfully installed Eclipse & the Force.com IDE using these instructions: https://www.adminhero.com/searching-salesforce-metadata-using-the-force-com-ide/. However, every time I try to create a project, no matter how big or how small the size of the data, I receive a heap size error.

I thought this would fix my problem: https://help.salesforce.com/articleView?id=Why-does-the-Force-com-IDE-time-out-or-display-a-Java-heap-size-error-when-I-m-building-a-new-project&language=en_US&type=1. It did not. I set it first to 1200m, then 2048m, no difference. Still hangs and eventually just errors. I'm at my wit's end. Any thoughts?
I'm very, very new to Apex and at a loss. I have a business requirement to update a custom Lead picklist field called "Qualification Status" to "Converted" when a Lead is converted. I've created the following Trigger:
trigger LeadQualStatusToConvertedTrigger on Lead (before update) {
    
    List<Lead> convertedLeads = new List<Lead>();
    
    for(Lead convertedLead : Trigger.New) {
        if (convertedLead.IsConverted) {
            convertedLeads.add(convertedLead);
        }
    }

    LeadQualStatusToConverted.setQualStatusConverted(convertedLeads);
}
I've tested LeadQualStatusToConverted.setQualStatusConverted() and it works. The issue is that nothing satisfies the Trigger's If clause. Here's a relevant piece of my test class:
@testSetup
    static void setup() {
        List<Lead> testLeads = new List<Lead>();
        for(Integer i=0; i<10; i++) {
            testLeads.add(new Lead(LastName = 'Smith' + i
                                  ,Company = 'Smith Co.'
                                  ,Qualification_Status__c = 'MQL'
                                  ,IsConverted = False));
        }
        
        Database.insert(testLeads);
    }

    @isTest
    static void TestUpdatedConvertedLead() {
        Lead testLead = [Select Id, Qualification_Status__c, IsConverted
                         From Lead
                         Where LastName='Smith1'];

        Test.startTest();
        Database.LeadConvert lc = new Database.LeadConvert();
        lc.setLeadId(testLead.Id);
        lc.setConvertedStatus('Qualified');
        Database.LeadConvertResult lcr = Database.convertLead(lc);
		Test.stopTest();
        
        System.assert(True,testLead.IsConverted);
        System.assert(lcr.isSuccess());
        System.assertEquals('Converted',testLead.Qualification_Status__c);
    }
The first two asserts pass, but the one that matters (the third), does not. The test result statest that the Qualification_Status__c is still the initialized value of MQL. So, it's successfully being converted, but not making it past the Trigger's If and thus not being passed to the setQualStatusConverted() method.

I'm at a loss... How can I check for IsConverted in the Trigger?
Hey everyone,

I'm going through the Apex H&T videos and on the DML and Loops section, they state that code sample 1 below is more efficien than sample 2. I can follow what's happening in 2 as it closely mirrors what I'm used to Flow (plus the minimal coding knowledge I have). But I'm having a tough time following sample 1, let alone understanding why it's more efficient. Any help would be appreciated, thanks!

Sample #1
User-added image

Sample #2
User-added image
Hey everyone,

I just completed the Security Superbadge and I found it rather confusing...not because it's particularly difficult to pass the individual steps/challenges, but because there are several red herrings that led me to believe I had to implement things that weren't actually tested. Examples:
  1. Remote workers must use VPN to access Salesforce.
  2. All mobile users must use two-factor authentication (2FA).
  3. All mobile users must be individually approved by the admin.
  4. Customer SSN and Bank Account fields on contact records must be encrypted.
None of these are checked in their entirety. Numbers 1, 3 and 4 are not ever checked in any way. I might just lack the knowledge here, but are numbers 2 & 3 even possible? That is, can you make 2FA only required on mobile? I don't even know what "individually approved by the admin" means in relation to mobile access. To that end, does it mean Salesforce1 or does it mean mobile browser loading Classic? In either case - is it even possible to prevent access to both from a profile-level perspective?

This challenge took me a while because of these red herrings. When I finally realized they're just superfluous I was able to easily breeze through the challenges. (Pretty frustrating experience...)
Hey everyone,

I just completed the Security Superbadge and I found it rather confusing...not because it's particularly difficult to pass the individual steps/challenges, but because there are several red herrings that led me to believe I had to implement things that weren't actually tested. Examples:
  1. Remote workers must use VPN to access Salesforce.
  2. All mobile users must use two-factor authentication (2FA).
  3. All mobile users must be individually approved by the admin.
  4. Customer SSN and Bank Account fields on contact records must be encrypted.
None of these are checked in their entirety. Numbers 1, 3 and 4 are not ever checked in any way. I might just lack the knowledge here, but are numbers 2 & 3 even possible? That is, can you make 2FA only required on mobile? I don't even know what "individually approved by the admin" means in relation to mobile access. To that end, does it mean Salesforce1 or does it mean mobile browser loading Classic? In either case - is it even possible to prevent access to both from a profile-level perspective?

This challenge took me a while because of these red herrings. When I finally realized they're just superfluous I was able to easily breeze through the challenges. (Pretty frustrating experience...)
I'm getting below error in Workflow Rule Migration module

Challenge Not yet complete... here's what's wrong: 
The process does not appear to be processing 'Closed Won' first and then 'Closed Won and Banking'

 
Best practice question... I'm writing a Trigger on after update, after delete. Should I place the DML statement in the Class method the Trigger is calling or within the Trigger itself?
I desperately want a way to search through our Org's metadata so I can clean things up. I've successfully installed Eclipse & the Force.com IDE using these instructions: https://www.adminhero.com/searching-salesforce-metadata-using-the-force-com-ide/. However, every time I try to create a project, no matter how big or how small the size of the data, I receive a heap size error.

I thought this would fix my problem: https://help.salesforce.com/articleView?id=Why-does-the-Force-com-IDE-time-out-or-display-a-Java-heap-size-error-when-I-m-building-a-new-project&language=en_US&type=1. It did not. I set it first to 1200m, then 2048m, no difference. Still hangs and eventually just errors. I'm at my wit's end. Any thoughts?
I'm very, very new to Apex and at a loss. I have a business requirement to update a custom Lead picklist field called "Qualification Status" to "Converted" when a Lead is converted. I've created the following Trigger:
trigger LeadQualStatusToConvertedTrigger on Lead (before update) {
    
    List<Lead> convertedLeads = new List<Lead>();
    
    for(Lead convertedLead : Trigger.New) {
        if (convertedLead.IsConverted) {
            convertedLeads.add(convertedLead);
        }
    }

    LeadQualStatusToConverted.setQualStatusConverted(convertedLeads);
}
I've tested LeadQualStatusToConverted.setQualStatusConverted() and it works. The issue is that nothing satisfies the Trigger's If clause. Here's a relevant piece of my test class:
@testSetup
    static void setup() {
        List<Lead> testLeads = new List<Lead>();
        for(Integer i=0; i<10; i++) {
            testLeads.add(new Lead(LastName = 'Smith' + i
                                  ,Company = 'Smith Co.'
                                  ,Qualification_Status__c = 'MQL'
                                  ,IsConverted = False));
        }
        
        Database.insert(testLeads);
    }

    @isTest
    static void TestUpdatedConvertedLead() {
        Lead testLead = [Select Id, Qualification_Status__c, IsConverted
                         From Lead
                         Where LastName='Smith1'];

        Test.startTest();
        Database.LeadConvert lc = new Database.LeadConvert();
        lc.setLeadId(testLead.Id);
        lc.setConvertedStatus('Qualified');
        Database.LeadConvertResult lcr = Database.convertLead(lc);
		Test.stopTest();
        
        System.assert(True,testLead.IsConverted);
        System.assert(lcr.isSuccess());
        System.assertEquals('Converted',testLead.Qualification_Status__c);
    }
The first two asserts pass, but the one that matters (the third), does not. The test result statest that the Qualification_Status__c is still the initialized value of MQL. So, it's successfully being converted, but not making it past the Trigger's If and thus not being passed to the setQualStatusConverted() method.

I'm at a loss... How can I check for IsConverted in the Trigger?
Hey everyone,

I'm going through the Apex H&T videos and on the DML and Loops section, they state that code sample 1 below is more efficien than sample 2. I can follow what's happening in 2 as it closely mirrors what I'm used to Flow (plus the minimal coding knowledge I have). But I'm having a tough time following sample 1, let alone understanding why it's more efficient. Any help would be appreciated, thanks!

Sample #1
User-added image

Sample #2
User-added image
Hey everyone,

I just completed the Security Superbadge and I found it rather confusing...not because it's particularly difficult to pass the individual steps/challenges, but because there are several red herrings that led me to believe I had to implement things that weren't actually tested. Examples:
  1. Remote workers must use VPN to access Salesforce.
  2. All mobile users must use two-factor authentication (2FA).
  3. All mobile users must be individually approved by the admin.
  4. Customer SSN and Bank Account fields on contact records must be encrypted.
None of these are checked in their entirety. Numbers 1, 3 and 4 are not ever checked in any way. I might just lack the knowledge here, but are numbers 2 & 3 even possible? That is, can you make 2FA only required on mobile? I don't even know what "individually approved by the admin" means in relation to mobile access. To that end, does it mean Salesforce1 or does it mean mobile browser loading Classic? In either case - is it even possible to prevent access to both from a profile-level perspective?

This challenge took me a while because of these red herrings. When I finally realized they're just superfluous I was able to easily breeze through the challenges. (Pretty frustrating experience...)
Getting this 
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: AUAWOAHH

I *did* create a new org for this superbadge. Anyone having issues like this?