• Tony White (BNE)
  • NEWBIE
  • 70 Points
  • Member since 2014
  • SMS Management & Technology

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 4
    Questions
  • 30
    Replies
I am needing to add a reCaptcha test in a Lightning community, but with the locker service the script has to be loaded from a static resource rather than directly from the Google website... but is that going to break it?  Guessing the only way to know is to try but would be good to know if others have tried already...
I am currently trying to debug a test class and have found that when you select just a single test method from the class it does not run the setup methods.  I need to run the code as various users, I am setting up the users in a @testSetup method, and then querying for that user in the first line of the test method.

When I run all tests in the class, it gets past this first line.
If I select just a single test method (so can focus on the errors it is producing) then it fails on the first line.
There is no option when you select the test methods to run to include the testSetup methods...

Anyone else seeing this?  Until I found this issue I thought the new feature was fantastic cause I no longer would have to comment out the other test methods to be able to just get debug for a single test method.  I see no metion of the test setup not running, in the release notes.

Thanks
Tony
We have a trigger using a single email message to send an email to a contact on a case, and save it as an activity on the case/contact.  But we are finding that the case owner is also getting a copy of the email.  Why?

This is the send email code we are using:
--------
                       Messaging.SingleEmailMessage singleMail = new Messaging.SingleEmailMessage();
                        //set object Id
                        singleMail.setTargetObjectId(contact.Id);
                        //set template Id
                        singleMail.setTemplateId(TemplateName));
                        // Set the whatId
                        singleMail.setWhatId(case.id);
                        //flag to true for inserting activity history
                        singleMail.setSaveAsActivity(true);
                        // Set the from address
                        singleMail.setOrgWideEmailAddressId(noReplyAddress.ID);

                        //add mail
                        emails2Send.add(singleMail);
....
Messaging.sendEmail(emails2Send);
I have a bit of a weird problem... the code below works correctly in our development environment, but when we load it into our UAT environment it does not work for 2 out of 3 people.  All 3 people have the same profile (sys admin), we have tried different browsers, using Eclipse but it only works for the 1 user.

Any suggestions as to what is going on?

Thanks
Tony

public class getDuplicateAffiliations {
    public class memberLodge { 
        id member;
        id lodge;
       
        public memberLodge(id m, id l){
            member = m;
            lodge = l;
        }
       
        public Boolean equals(Object obj) {
            system.debug('CompareA:'+member+','+lodge);
            system.debug('Compareb:'+((memberLodge)obj).member+','+((memberLodge)obj).lodge);
            return (member == ((memberLodge)obj).member && lodge == ((memberLodge)obj).lodge);
        }
    }
   
    public static List<npe5__Affiliation__c> getDuplicates() {
       
        List<position__c> positionList = [select id, end_date__c, Member_Lodge_Affiliation__r.npe5__Contact__c from position__c
                                          where end_date__c = null and Member_Lodge_Affiliation__r.npe5__EndDate__c != null];
        List<id> memberList = new List<id>();
        for (position__c p : positionList) {
            memberList.add(p.Member_Lodge_Affiliation__r.npe5__Contact__c);
        }
       
        System.debug(positionList);
        System.debug(memberList);
       
        map<memberLodge, npe5__Affiliation__c> affiliations = new map<memberLodge, npe5__Affiliation__c>();
        List<npe5__Affiliation__c> duplicateAffil = new List<npe5__Affiliation__c>();
       
        for (npe5__Affiliation__c aff : [select id, npe5__Contact__c, npe5__Organization__c, Lodge_Masonic_Status__c
                                         from npe5__Affiliation__c
                                         where npe5__Contact__c in :memberList]) {
                                             memberLodge key = new memberLodge(aff.npe5__Contact__c, aff.npe5__Organization__c);
                                             System.debug('aff:'+aff);
                                             System.debug('mlkey:'+key);
                                             if(affiliations.containsKey(key)) {
                                                 duplicateAffil.add(aff);
                                                 duplicateAffil.add(affiliations.get(key));
                                             }                          
                                             else {
                                                 affiliations.put(key,aff);
                                             } 
                                         }
        System.debug(duplicateAffil);
        return duplicateAffil;
    }
   
}

Hello,

I am created an LWC quick action to be added to a record layout page. It is required to wrap the content of the modal in a lightning-quick-action-panel as per this dev guide Create Screen Quick Actions (https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_quick_actions_screen).

I have got this working perfectly.

My question is about increasing horizontal space taken by the modal when it is open.

 

Modals aren't supported by styling hooks mechanisms, so I can't use them.

I tried overriding slds-modal__container without success unlike for aura components.

Can this be done?

About a week after the Spring '19 rollout, we've suddenly ran into an issue around Email Template visibilty for Customer Community Users. 

TLDR; Email Templates are not visible to Customer Community licensed Users, regardless of the access settings on the Folder under which the template resides. 

Our specific configuration is as follows - keep in mind that the custom implementations mentioned have been in place since 2015, and have not been changed in the last year if not more. 

We have a Visual Force + Tabs community that serves as a Customer Support portal

We have setup an Apex 'After Insert' Trigger on the Reply SObject to send notification emails to the original poster and those subscribed to the category/area the question was posted, of a new response to the question. 

The Trigger calls a Future Method with Callouts method on a 'With Sharing' APEX Class that compiles the needed User collection to notify, before calling an Email Helper class to send the notification emails. 

The Email Helper method which sends the notification emails does so via an Email Template (html) - the email template used is hard coded, and is within a folder accessible to the public. 

The Email Helper fails with a SOQL Exception 'List has no rows for assignment to SObject' on the following query used to retrieve the Email Template

    EmailTEmpalte template = [Select id, body, Name from EmailTemplate where Name = :templateName limit 1];    

I understand the nature of the SOQL Error, and have verified that only a single record exists that fulfills the condition. 

To further test, I wrote a Test Method which creates users of all the Profiles we have in our Org Currently, and runs a simple 'Select All' query on Email Templates to quickly see if Email Templates are visible at all to the Community User profiles. 

This test method revealed that ANY of our Customer Community licensed profiles are not able to see ANY of our email templates, regardless of the folder's access settings. Any of the Salesforce User Licensed profiles can see the template. 

After all my investigation so far, this is really starting to smell like a Platform issue, perhaps something rolled out with Spring '19 or shortly there after. 

Salesforce Support confirmed this morning that its unexpected that the templates are not visible in their current configuration.

Any help on this is greatly appreciated; thanks in advance.

--Paul

 

I am trying to complete the Lightning Experience Rollout Specialist  super badge. But I do not have a Destination Success.png document or a Destination Success Home Page component. I installed the unmanaged package, as required.

Thoughts?

Hi,

I am getting the error as below

Didn't find the All Lusso Scarpe Employee group record page

Could you please suggest me
I'm having problems with the Check Challenge on step 6, with regards to the Chatter Group.

I have created the Chatter group and a lightning page to support it. I have been getting this error for the last hour:
User-added image

It's driving me nuts - I've tried everything, even renaming the page. It's quite clearly there.

User-added image

Salesforce is this a bug?

Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.

I've built out my process builder as follows

User-added image
User-added image
User-added image

And my date formula as follows
 

Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")
 



Challenge Not yet complete... here's what's wrong:  The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday. 

It works nicely but doesn't seem to pass, what could be up.
 

There was an unhandled exception. Please reference ID: KLNTXAZY. Error: Faraday::ClientError. Message: MALFORMED_QUERY: When retrieving results with Metadata or FullName fields, the query qualificatio​ns must specify no more than one row for retrieval. Result size: 2

I have a flow that allows you to choose the product type, then the product, which creates the product, then asks if you want to add more products and goes back to the start. Seems to work perfectly. Not sure what this error is.

I am seeing the following error when attempting to check the first challenge in the Process Automation Specialist Superbadge:

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: SJNXHSJT

I am using a brand new DE org. Has anyone seen something similar for this superbadge?
I'm unable to check step 2: Automate Accounts because I'm receiving this error: 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: ZKCVFIZH
 
I am needing to add a reCaptcha test in a Lightning community, but with the locker service the script has to be loaded from a static resource rather than directly from the Google website... but is that going to break it?  Guessing the only way to know is to try but would be good to know if others have tried already...
All, I'm receiving the below error when trying this challenge.
The 'Sales Manager' dashboard does not have the correct headers and titles for the chart components.

I've tried many things including changing the base field for the Summary to the OOB fields, but it doesn't help.  My configurations are shown below and seem to match the requirements as exactly as I can find.  Does anyone else have any suggestions?  Can't find a Salesforce help for the Superbadges.

User-added image
Hello,

I have a component, which has an aura:attribute with the type Aura.Action and a button, which calls this action.
<aura:attribute name="onproceed" type="Aura.Action" default="{!c.defaultCloseAction}"/>

<button onclick="{!v.onproceed}" />

Now I want to dynamically create this component in my controller and pass my custom action as a parameter to this component:
openWindow : function(component,event,helper) {

        $A.createComponent(
            "c:windowComponent",
            {
                "onproceed": function(){
                    alert('Success');
                }
            },
            function(window){
                if (component.isValid()) {
                    var targetCmp = component.find('windowDiv');
                    var body = targetCmp.get("v.body");
                    body.push(window);
                    targetCmp.set("v.body", body); 
                }
            }
        );
    },
There comes the error message: "action.runDeprecated is not a function".
What type of action should I pass here? Is it possible to do it with such a callback?
Do I have to pass my custom method from the controller?

A workaround for me would be to do it with events, but maybe this solution works somehow.
Hi,

I created a class in my PROD environment that implements SandboxPostCopy. My undersating is that when I create/refresh a sandbox and specify my class, the code in that class will be executed upon creating/refreshing the sandbox.

Here is the code I am using for the SandboxPostCopy class.
global class SandboxRefreshCutover implements SandboxPostCopy {

    global void runApexClass(SandboxContext context) {

        System.debug('Sandbox copy done. ' + context.organizationId() + ' ' + context.sandboxId() + context.sandboxName());
        
        //Replace the URL endpoint in a Customer Setting
        Integration_Endpoints__c integrationEndpoint = Integration_Endpoints__c.getValues('TEST');
        if(integrationEndpoint != null)
        {
            integrationEndpoint.URL__c = 'http://www.test.com';
            update integrationEndpoint;
        }
        else
        {
            integrationEndpoint = new Integration_Endpoints__c(Name = 'TEST', URL__c = 'http://www.test.com');
            insert integrationEndpoint;
        }
    }
}

Now, I tried to create a few developer sandboxes and everytime the code is not executed.
Am I missing something?

Thanks a lot in advance.
Etienne

Hi all, I am so close to finishing this process automation badge but am stuck in one area in Step 7.

I've built out my process builder as follows

User-added image
User-added image
User-added image

And my date formula as follows
 

Case(MOD(Date__c-DATE(1900,1,7),7),0,"Sunday",1,"Monday",2,"Tuesday",3,"Wednesday",4,"Thursday",5, "Friday",6,"Saturday", "")
 



Challenge Not yet complete... here's what's wrong:  The Robot Setup Day of the Week formula does not seem to be working properly. The Day of the Week should not fall on Saturday or Sunday. 

It works nicely but doesn't seem to pass, what could be up.
 

Wow.  That was insanely hard.  It took me a solid 2 days to complete (4-6 hours?! no.).  Here are some tips:
  • It has been updated in the past few weeks, so beware of older comments and screenshots that people share.  You should NOT copy them!
  • Detail, detail, detail.  For ALL items you create, copy and paste the names into the blanks - report names, dashboard titles, group names, etc. Check twice.
  • Expect to run into "bugs".  There were easily a dozen that I had to work around carefully.  It started with importing data needing to be CSV parsed, and ended with not being able to move the Lightning report into a folder.  
  • Before hitting the "Check Challenge" button, re-read the description of the step!  And always do them in order.  They build on each other and are pretty good about telling you what will be checked. (in this SuperBadge, at least..)
Now, some specifics about the steps:
  1. Data import was a bit off.  Excel doesn't like to export 1 tab at a time, so be very diligent about checking each CSV to see that it's good.  For some reason, the Hobby list gave me problems, so I added some data that I never mapped upon import.  And details.. a lot of details.
  2. There was an underlying report that wasn't really discussed much, so I had to create it carefully and tweak it until it did what I wanted.  And again, details.
  3. Flipping from Classic to Lightning is easy, but you have to be sure that everything is there and ready to go before you do.  As I found out the hard way, you can't edit in Classic after you start editing in Lightning, so that affects this step and step 6.  Oh, and details.. names, etc.
  4. I can't remember anything specific about this step.  But, details.
  5. I did these reports first (before checking any challenges), and it took a LONG time.  There are so many parts to get right.  The custom report type is the real key, though.  Read very carefully when setting it up, because a wrong choice there will cascade down to all of the reports and make life miserable.  Also, for some reason, my matrix report kept re-inserting columns that I had removed, so I had to check that report EVERY time I edited it.  Oh, and details, once again.
  6. This one was pretty easy once I saw the notes at the BOTTOM of the description (about creating the user, etc.).  I had already worked on the Security Superbadge (stuck, tho) so I knew how to work these well.  But as I said earlier, the Lightning Dashboard gave me the worst trouble.  I found a SFDC webpage that said it was impossible to move the dashboard into another folder!  So, improvise, which ended up working.  Oh, and yea, as you would guess... details!
I LOVED this challenge.  It took me probably 14-16 hours.  But now I feel very versed in these topics.  Thanks, SFDC and TrailHead folks!