• Federico Giust 7
  • NEWBIE
  • 94 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I am going after the Lightning Experience roll-out specialist badge and I am having issues with challenge #10. Could you give me some pointers on how to finish this challenge?  

Here is my error : The Lightning component named TrailheaDX must open a link to https://developer.salesforce.com/trailheadx/, must open in a new window (using the target attribute of ui:outputurl), and must be included in the Sales app. 

Here is my code 

Component : 

<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <aura:attribute name="myURL" type="String" default="https://developer.salesforce.com/trailheadx/"/>
    <br/><br/>
    <ui:outputURL value="{!v.myURL}" label="TrailheaDX" target="_blank"/>
    <br/>
</aura:component>



Controller : 


({
    navigate : function(component, event, helper) {
        var address = component.find("address").get("v.myURL");
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url": 'https://developer.salesforce.com/trailheadx/' + address
        });
        urlEvent.fire();
    }
})




In addition, i added the app to the utility bar and the homepage of the lightning sales app. 

Could you give me any pointers on how to finish this challenge? 


User-added image

User-added image
Hi all, I am stuck on the prevent SOQL injection trailhead, where I am looking to determine which portions of the code I would need to invoke escapeSingleQuotes or whitelist to enable. I've made several attempts at investigation to little avail. I have appended my code are there any steps I would need to take. My goal is to assess the code to see how it works and what I would need to do.

Hope it helps.
 
public class Prevent_SOQL_Injection_Challenge {

    public string textOne {get; set;}
    public string textTwo {get; set;}
    public string comparator {get; set;}
    public string numberOne {get; set;}

    public List<Supply__c> whereclause_records {get; set;}


    public PageReference stringSearchOne(){
        string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c';
        string whereClause = '';

        if(textOne != null && textOne!=''){
                whereClause += 'name like  \'%'+textOne+'%\' ';
        }

        if(whereClause != ''){
            whereclause_records = database.query(query+' where '+whereClause+' Limit 10');
        }

        return null;
    }


    public PageReference stringSearchTwo(){
        string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c';
        string whereClause = '';

        if(textTwo != null && textTwo!=''){
                whereClause += 'Storage_Location__r.name like  \'%'+textTwo+'%\' ';
        }

        if(whereClause != ''){
            whereclause_records = database.query(query+' where '+whereClause+' Limit 10');
        }

        return null;
    }


    public PageReference numberSearchOne(){
        string query = 'SELECT Id,Name,Quantity__c,Storage_Location__c,Storage_Location__r.Castle__c,Type__c FROM Supply__c';
        string whereClause = '';

        if(numberOne != null && comparator != null){
            whereClause += 'Quantity__c '+comparator+' '+numberOne+' ';
        }

        if(whereClause != ''){
            whereclause_records = database.query(query+' where '+whereClause+' Limit 10');
        }

        return null;
    }

}