• kavya mareedu
  • NEWBIE
  • 105 Points
  • Member since 2018
  • Salesforce Developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 35
    Questions
  • 40
    Replies
You have one or more certificates in your Salesforce org Salesforce 00D0o0000016PXb that will expire soon. Review the list below and visit Certificate and Key Management from Setup to make an update.

   - SelfSignedCert_25Jun2019_135552, Self-Signed, expires on 6/25/2020. Warning: This certificate will expire in 60 day(s).

As far as I know I have finished all maintenance exams. I am not sure why I have recieved this. I am not sure how to figure out this. I need helpppppppp
Component: 
<aura:component>
     <aura:handler event="c:AccountsLoaded" action="{!c.onAccountsLoaded}"/>
    <aura:attribute name="map" type="Object"/>
     <aura:attribute name="accounts" type="Account" />
    <ltng:require styles="/resource/leaflet/leaflet.css" scripts="/resource/leaflet/leaflet.js" afterScriptsLoaded="{!c.jsLoaded}" />
    <div id="map"/>
</aura:component>

JS:

({
    
    jsLoaded: function(component, event, helper) {
       var accounts = event.getParam('accounts');
        for (var i=0; i<accounts.length; i++) {          
            var account = accounts[i];
            var map = L.map('map', {zoomControl: false}).setView([account.BillingLatitude, account.BillingLongitude],11);
            L.tileLayer(
            'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
            }).addTo(map);
        component.set("v.map", map);
        
        var circle = L.circle([account.BillingLatitude, account.BillingLongitude], {
            color: 'red',
            fillColor: '#f03',
            fillOpacity: 0.5,
            radius:10000
        }).addTo(map);
        
        L.marker([account.BillingLatitude, account.BillingLongitude]).addTo(map).bindPopup(account.Name).openPopup(); 
        //L.marker([account.BillingLatitude, account.BillingLongitude]).addTo(map).bindPopup('Hyatt').openPopup(); 
        //L.marker([account.BillingLatitude, account.BillingLongitude]).addTo(map).bindPopup('Marriott Marquis').openPopup();
        

        }      
    }
})


Error: 

This page has an error. You might just need to refresh it. Action failed: c:leafflet$controller$jsLoaded [Unable to get property 'length' of undefined or null reference] Failing descriptor: {c:leafflet}
({ jsLoaded: function(component, event, helper) { var map = L.map('map', {zoomControl: false}) .setView([51.5, -0.09], 13); L.tileLayer( 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri' }).addTo(map); component.set("v.map", map);var circle = L.circle([51.508, -0.11], {color: 'red',fillColor: '#f03',fillOpacity: 0.5,radius: 500}).addTo(map);var polygon = L.polygon([[51.509, -0.08],[51.503, -0.06],[51.51, -0.047]]).addTo(map);}})[[code]]czowOlwiXCI7e1smKiZdfQ==[[/code]]

In my requirement I have a form as shown below:

In the highlighted part the customer will choose the closest regional hub where he lives, but there are close to 700 options in this picklist. I want to enhance this field in such a way, I will replace this picklist with ZipCode. Whenever the customer gives you any input as Zipcode we should show him a map highlighting the place which he has given and from there taking that highlighted place as center we should add a radius to the map upto 10 kms and show what all places he can choose in that places.
User-added image

 
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")}
var url = parent.location.href;
var records = {!GETRECORDIDS($ObjectType.Opportunity)};
var updateRecords = [];

if (records[0] == null) { //if the button was clicked but there was no record selected
alert("Please select at least one record to update."); //alert the user that they didn't make a selection
} else { //otherwise, there was a record selection
for (var a=0; a<records.length; a++) { //for all records
var update_Opportunity = new sforce.SObject("Opportunity"); //create a new sObject for storing updated record details
update_Opportunity.Id = records[a]; //set the Id of the selected Opportunity record
update_Opportunity.OwnerID= "0050V0000073CQuQAM"; //set the value for Status to 'Unqualified'
updateRecords.push(update_Opportunity); //add the updated record to our array
}
result = sforce.connection.update(updateRecords); //push the updated records back to Salesforce
parent.location.href = url; //refresh the page
}
global class OTFAutomationReport implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext bc)
    {
        //String query = 'select Id,OTF_Total_Hours__c,OTFClient__c, OTF_Date__c, (select Date__c, Duration_Hours__c from Time_Logs__r) from account where Name='+80 Acres Farms+';
       
        
        system.debug('==query==>' +[select Id,OTF_Total_Hours__c,OTFClient__c, OTF_Date__c, (select Date__c, Duration_Hours__c from Time_Logs__r) from account where Name='80 Acres Farms']);
        return Database.getQueryLocator([select Id,OTF_Total_Hours__c,OTFClient__c, OTF_Date__c, (select Date__c, Duration_Hours__c from Time_Logs__r) from account where Name='80 Acres Farms']);
       
    }
    global void execute(Database.BatchableContext bc, List<account> scope)
    {
        system.debug('==scope==>' +scope);
        //decimal TotalHours=0.0;
        list<account> accUpdate = new list<account>();
        for(account a: scope)
           
        {
            a.OTF_Total_Hours__c=0.0;
            system.debug('a===>1st loop' +a);
            for(Time_Log__c tl : a.Time_Logs__r)
            { system.debug('a===>2nd loop' +tl);
            
                //system.debug('a==a.OTF_Total_Hours__c=>2nd loop' +a.OTF_Total_Hours__c);
             system.debug('a=tl.Duration_Hours__c==>2nd loop' +tl.Duration_Hours__c);
            
                if(tl.Duration_Hours__c!=NUll && a.OTF_Total_Hours__c!=Null){
                a.OTF_Total_Hours__c +=tl.Duration_Hours__c;
                system.debug('==TotalHours==>' +a.OTF_Total_Hours__c);
                if(a.OTF_Total_Hours__c>=20 && a.OTFClient__c==false)
                {
                    a.OTFClient__c=true;
                    system.debug('==a.OTFClient__c==>' +a.OTFClient__c);
                    a.OTF_Date__c=tl.Date__c;
                    accUpdate.add(a);
                }
                }
            }
           
            
        }
        system.debug('==accUpdate > ' +accUpdate);
        update accUpdate;
       
    }
    global void finish(Database.BatchableContext BC)
    {}   
    
}
 
Hello Team,

I need help in building process builder. My requirement is on Account object there is a field(Multi select Picklist) called "Ecosystem Partners" with 9 different values say a,b,c,d,e,f,g,h,i. Now, when I select any of the ecosystem partner it should add the "user" who is associated with one of the ecosystem partners as an account team member. I can achive this functionality when one value is selected. If multiple values are selected then multiple members should be added as account team members. Please guide me 
My Requirement is:
 
My client wants to see all the picklist field values whenever he hover on the help text. The limit for help text field is 255 characters. My picklist values are more than 255 characters so we are not able to place those picklist values in helptext field. 

Now, I want to suggest him a work around for that. We want to create a custom formula field with text as returning value. I want to write a formula in such a way that it should show all the picklist field values. How to write a formula for that?
 
Analytics data preparation specialist - challenge 3
In your process you will create a new Seed Bank Agencies dataset.
Load the pre-populated Account object.
Load the Agency Detail.txt file to update the Account object with the recently added fields since the initial import.
Create a filter to select records associated with the Seed Bank project from the Account object.
Add the custom fields from the Agency Detail.txt file to the Account object.
Register the Account object as the new Seed Bank Agencies dataset.

Yasmine is curious to see what Mosaic will be able to do with the new datasets you'll be creating. With that in mind, you show Benito how to create lenses from the datasets for the executive team to experiment with.
I am trying to set notification for my dashboards, I don't know where did I do a mistake it is not accepting the changes. 

This is a task given in Trailhead. 

Personalize Your Analytics  is the module name. 

I am really getting stuck in Einstein ANalytics. I am not getting proper help. Please help me in figuring out things.
User-added image
In your process you will create a new Seed Bank Agencies dataset.
Load the pre-populated Account object.
Load the Agency Detail.txt file to update the Account object with the recently added fields since the initial import.
Create a filter to select records associated with the Seed Bank project from the Account object.
Add the custom fields from the Agency Detail.txt file to the Account object.
Register the Account object as the new Seed Bank Agencies dataset.

Yasmine is curious to see what Mosaic will be able to do with the new datasets you'll be creating. With that in mind, you show Benito how to create lenses from the datasets for the executive team to experiment with.
I have integrated my OutLook and Salesforce. User-added image
Now when I logged in to my Salesforce account, I clicked on create and tried to send an email. But I don't see that option at all. SendEmail is one of the Global actions. I find many other Global Actions but SendEmail is not there. Please suggest me what needs to be done.
Hello Team,

You see I am exhausted with all the playGrounds. I want to start doing my superbadges for that I need atleast two new playgrounds. 

Can I create a new org for myself and link it with the old one so that all my points badges get linked to the new org. 

Will this work out??
Or you guys have anything else to suggest me on this
From the toolbox, drag the Apex Action element onto the canvas.
For Apex Action, enter BankService and select BankService_addAccount.
For Label, use Add Employee Record.
Under Set Input Values, select to include accountName and accountType. For accountName, enter Name and select Name_on_Account. For accountType, enter Type and select Account_Type.
Select Set Output Values.
For accountDetails_type_201, click New Resource to create a variable with these properties.
Resource Type: Variable.
API Name: accountTypeField
Data Type: Record
Object: User
Availability Outside the Flow: Available for output
Click Done.
For accountDetails_type_201, enter account, click > next to the accountTypeField variable you created, and selectAccount_Type__c. This way, when the Apex action finishes, the flow stores the value of accountDetails_type_201 in a specific field on the accountTypeField variable.
Click Done.

Soon after dragging the ApexAction into the canvas I am not able to find BankService. Why is this like this???

Help me I am stuck here still not able to figure out
I am working On Business Administration Super Badge people. When I am trying to import the File they are asked me to do via data Loader I am not able to do it. When I checked the Login History it says API security Token required. When I reset the security token and tried to loggin back it gives me the same error. How should I achieve my challenge 1. It's more than 3 hours I am not able to fix it. Please help me folks.

I have to write a test class for the below schedule apex class, That too with 100% code coverage and system assert equals. How should I start what to do please help me. I really really need all you guys support.

global class DailyPrintbleAndDossierScheduler implements Schedulable
{
    global void execute(SchedulableContext ctx)
    {
        database.executeBatch(new BrokerDataAggregateResultDeleteBatch());
        database.executeBatch(new BrokerDataTopOfficesDeleteBatch());
        database.executeBatch(new BrokerDataSummaryDeleteBatchController());
    }
}

I want to retrieve all the fields from record type of an particular SObject. Please do let me know how to write the SOQL Query on this.
Hello SFDC Family,

Today I was doing a challenge in trailhead and the name of it is "
Create New Users and Allow a User to Delete Accounts" . In this challenge I have to create 4 users and for one user I have to give extra permission to delete the record. My issue is we only have limit for 3 salesforce Platform licenses in Developer Edition then why is in the challenge it is asking us to create 4 users with Salesforce Platform Licenses. How Should I overcome this and complete the challenge?
Topic Name: 
Extend Your Reporting Strategy with the AppExchange


Challenge is:

You’ve been asked to create a new Lead trending dashboard. Rather than creating the dashboard from scratch, install a CRM adoption dashboard package from AppExchange in your Trailhead Playground and update one of the dashboard components as specified below. (Note: While it's a best practice to clone a dashboard before you modify it, for this example, you can go ahead and edit the dashboard directly.)
Get your username and password for your Trailhead Playground using the instructions in this article
Install Salesforce Adoption Dashboards from AppExchange into your Trailhead Playground
Refresh the 3 - Sales & Marketing Adoption dashboard in the Salesforce Adoption Dashboards folder at least once
In the 3 - Sales & Marketing Adoption dashboard, edit the New LEAD Trend by Source component and uncheck the Use chart as defined in source report option
Change the dashboard component for New LEAD Trend by Source to a pie chart and set the wedges to Lead Source
Save your changes
Having trouble installing your app? Read this article for help
I want to collect past 5 years data for a scenerio, let's say data from 2019,2018,2017,2016,2015.

I want to label 2019 data as Current_Year
2018 as Previous_Year
2017,2016,2015 as what??? Do you guys have any suggestion for me.

I don't want to hard code the years in number

Any suggestions please??????????????
Ans:  Text, Text Area, Text Area Long, Rich Text Area, URL. Is this is the right answer or is there something else????

13. Can we change the data type from Text to Auto Number for the Name when we already have?

Ans: I feel the answer is yes. If yes, please do let me know the explanation . If no, let me know the reason as well. Thanks guys. 

 
Modify an AppExchange dashboard
Maria Jimenez is looking for reports and dashboards on AppExchange to track her team's transition to Lightning Experience. Install the AppExchange Dashboard Pack for Sales, Marketing and Service package into your Trailhead Playground and make some modifications. 

You’ll need your hands-on org username and password to complete this challenge. If you're using a Trailhead Playground, this article shows you how to find your username and reset your password. If you have trouble installing the package, follow the steps in this article.

In your Trailhead Playground, install the AppExchange Dashboard Pack for Sales, Marketing and Service.
Clone the 1-Account, Contact & Opportunity Data Quality dashboard and name it My Account and Contact Dashboard.
Add a dashboard filter on the Billing City field so that the dashboard only shows info about Accounts in London.
Save and refresh the dashboard.

I am trying to complete this challenge from past 4 hours still am not able to do it. Please help me guys! Guide me!!!!
Component: 
<aura:component>
     <aura:handler event="c:AccountsLoaded" action="{!c.onAccountsLoaded}"/>
    <aura:attribute name="map" type="Object"/>
     <aura:attribute name="accounts" type="Account" />
    <ltng:require styles="/resource/leaflet/leaflet.css" scripts="/resource/leaflet/leaflet.js" afterScriptsLoaded="{!c.jsLoaded}" />
    <div id="map"/>
</aura:component>

JS:

({
    
    jsLoaded: function(component, event, helper) {
       var accounts = event.getParam('accounts');
        for (var i=0; i<accounts.length; i++) {          
            var account = accounts[i];
            var map = L.map('map', {zoomControl: false}).setView([account.BillingLatitude, account.BillingLongitude],11);
            L.tileLayer(
            'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
            }).addTo(map);
        component.set("v.map", map);
        
        var circle = L.circle([account.BillingLatitude, account.BillingLongitude], {
            color: 'red',
            fillColor: '#f03',
            fillOpacity: 0.5,
            radius:10000
        }).addTo(map);
        
        L.marker([account.BillingLatitude, account.BillingLongitude]).addTo(map).bindPopup(account.Name).openPopup(); 
        //L.marker([account.BillingLatitude, account.BillingLongitude]).addTo(map).bindPopup('Hyatt').openPopup(); 
        //L.marker([account.BillingLatitude, account.BillingLongitude]).addTo(map).bindPopup('Marriott Marquis').openPopup();
        

        }      
    }
})


Error: 

This page has an error. You might just need to refresh it. Action failed: c:leafflet$controller$jsLoaded [Unable to get property 'length' of undefined or null reference] Failing descriptor: {c:leafflet}
({ jsLoaded: function(component, event, helper) { var map = L.map('map', {zoomControl: false}) .setView([51.5, -0.09], 13); L.tileLayer( 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', { attribution: 'Tiles © Esri' }).addTo(map); component.set("v.map", map);var circle = L.circle([51.508, -0.11], {color: 'red',fillColor: '#f03',fillOpacity: 0.5,radius: 500}).addTo(map);var polygon = L.polygon([[51.509, -0.08],[51.503, -0.06],[51.51, -0.047]]).addTo(map);}})[[code]]czowOlwiXCI7e1smKiZdfQ==[[/code]]

In my requirement I have a form as shown below:

In the highlighted part the customer will choose the closest regional hub where he lives, but there are close to 700 options in this picklist. I want to enhance this field in such a way, I will replace this picklist with ZipCode. Whenever the customer gives you any input as Zipcode we should show him a map highlighting the place which he has given and from there taking that highlighted place as center we should add a radius to the map upto 10 kms and show what all places he can choose in that places.
User-added image

 
global class OTFAutomationReport implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext bc)
    {
        //String query = 'select Id,OTF_Total_Hours__c,OTFClient__c, OTF_Date__c, (select Date__c, Duration_Hours__c from Time_Logs__r) from account where Name='+80 Acres Farms+';
       
        
        system.debug('==query==>' +[select Id,OTF_Total_Hours__c,OTFClient__c, OTF_Date__c, (select Date__c, Duration_Hours__c from Time_Logs__r) from account where Name='80 Acres Farms']);
        return Database.getQueryLocator([select Id,OTF_Total_Hours__c,OTFClient__c, OTF_Date__c, (select Date__c, Duration_Hours__c from Time_Logs__r) from account where Name='80 Acres Farms']);
       
    }
    global void execute(Database.BatchableContext bc, List<account> scope)
    {
        system.debug('==scope==>' +scope);
        //decimal TotalHours=0.0;
        list<account> accUpdate = new list<account>();
        for(account a: scope)
           
        {
            a.OTF_Total_Hours__c=0.0;
            system.debug('a===>1st loop' +a);
            for(Time_Log__c tl : a.Time_Logs__r)
            { system.debug('a===>2nd loop' +tl);
            
                //system.debug('a==a.OTF_Total_Hours__c=>2nd loop' +a.OTF_Total_Hours__c);
             system.debug('a=tl.Duration_Hours__c==>2nd loop' +tl.Duration_Hours__c);
            
                if(tl.Duration_Hours__c!=NUll && a.OTF_Total_Hours__c!=Null){
                a.OTF_Total_Hours__c +=tl.Duration_Hours__c;
                system.debug('==TotalHours==>' +a.OTF_Total_Hours__c);
                if(a.OTF_Total_Hours__c>=20 && a.OTFClient__c==false)
                {
                    a.OTFClient__c=true;
                    system.debug('==a.OTFClient__c==>' +a.OTFClient__c);
                    a.OTF_Date__c=tl.Date__c;
                    accUpdate.add(a);
                }
                }
            }
           
            
        }
        system.debug('==accUpdate > ' +accUpdate);
        update accUpdate;
       
    }
    global void finish(Database.BatchableContext BC)
    {}   
    
}
 
Hello Team,

I need help in building process builder. My requirement is on Account object there is a field(Multi select Picklist) called "Ecosystem Partners" with 9 different values say a,b,c,d,e,f,g,h,i. Now, when I select any of the ecosystem partner it should add the "user" who is associated with one of the ecosystem partners as an account team member. I can achive this functionality when one value is selected. If multiple values are selected then multiple members should be added as account team members. Please guide me 
In your process you will create a new Seed Bank Agencies dataset.
Load the pre-populated Account object.
Load the Agency Detail.txt file to update the Account object with the recently added fields since the initial import.
Create a filter to select records associated with the Seed Bank project from the Account object.
Add the custom fields from the Agency Detail.txt file to the Account object.
Register the Account object as the new Seed Bank Agencies dataset.

Yasmine is curious to see what Mosaic will be able to do with the new datasets you'll be creating. With that in mind, you show Benito how to create lenses from the datasets for the executive team to experiment with.
I am working On Business Administration Super Badge people. When I am trying to import the File they are asked me to do via data Loader I am not able to do it. When I checked the Login History it says API security Token required. When I reset the security token and tried to loggin back it gives me the same error. How should I achieve my challenge 1. It's more than 3 hours I am not able to fix it. Please help me folks.

I have to write a test class for the below schedule apex class, That too with 100% code coverage and system assert equals. How should I start what to do please help me. I really really need all you guys support.

global class DailyPrintbleAndDossierScheduler implements Schedulable
{
    global void execute(SchedulableContext ctx)
    {
        database.executeBatch(new BrokerDataAggregateResultDeleteBatch());
        database.executeBatch(new BrokerDataTopOfficesDeleteBatch());
        database.executeBatch(new BrokerDataSummaryDeleteBatchController());
    }
}

Topic Name: 
Extend Your Reporting Strategy with the AppExchange


Challenge is:

You’ve been asked to create a new Lead trending dashboard. Rather than creating the dashboard from scratch, install a CRM adoption dashboard package from AppExchange in your Trailhead Playground and update one of the dashboard components as specified below. (Note: While it's a best practice to clone a dashboard before you modify it, for this example, you can go ahead and edit the dashboard directly.)
Get your username and password for your Trailhead Playground using the instructions in this article
Install Salesforce Adoption Dashboards from AppExchange into your Trailhead Playground
Refresh the 3 - Sales & Marketing Adoption dashboard in the Salesforce Adoption Dashboards folder at least once
In the 3 - Sales & Marketing Adoption dashboard, edit the New LEAD Trend by Source component and uncheck the Use chart as defined in source report option
Change the dashboard component for New LEAD Trend by Source to a pie chart and set the wedges to Lead Source
Save your changes
Having trouble installing your app? Read this article for help
I need help in writing a batch apex class. I have two custom objects Agg_Datas_c and Agg_Datas_Final_c

In the two objects we have same fields they are called 18 GWP,19 GWP, 18 commission, 19 commission also a picklist field. 

I have a write a batch apex class in such a way that I should fetch the aggregate data from database in start method. 

In execute method I have to calculate variance and variancepercent

In finish method I have to put the data in other object. I am stuck in middle please help me.

global class Batch_AggregateDataTransfer implements Database.Batchable<sObject> {
    //start method to fetch the aggregate data from Database.
    global Database.QueryLocator start(Database.BatchableContext BC){
        string query ='SELECT SUM(X2018_GWP__c),SUM(X2019_GWP__c) FROM Agg_Data_c__c';
        return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext BC, List<Agg_Data_c__c> Batch){
        for(Agg_Data_c__c obj_Agg: Batch){
            AggregateResult ar = (AggregateResult)obj_Agg;
            Double counter1 = Double.valueOf(ar.get('X2018_GWP__c'));
            Double counter2 = Double.valueOf(ar.get('X2019_GWP__c'));
            Double variance=counter1-counter2;
            Double variancePercent= (counter1-counter2)*0.01;
            
        }
    }
    global void finish(Database.BatchableContext BC){
        {
            
        }
        
    }
    
}
Hi  i am new in Salesforce
I am Beginner
So Please Help me Out from this Scenario

When an Account's Billing Zip/Postal Code field value is changed and entered new value then
this situation will occur
1.Change the Account Owner to the Sales Representative assigned to the new zip code(Sales Representative is users that will be in another custom Object Terriotry object its a lookup )
2.Change the Owner Field of all the Account's Contacts to the same Sales Representative
3.Change the Owner Field of all the Account's Open Opportunities to the Same Sales RepresentativeIn this Image this are the Sales Representative in Custom Object TerritoryIn this Image This are the Custom fileds of territory objectSo Please Help Me out From this Scenario How to Start From where i dont know 

Please Reply As Soon Possible

Thanks
Neeraj Sharma
public class Colors {
    public string colors;
    public List<string> myList;
    public set<string> newList;
    
    public colors(){
        myList=new List<string>{'Blue','Blue violet','Red','Green','Dark Red','Light Red','Orange Red','Coral Red',
            'Forest Green','Hunter Green','Sage Green','Black','Red','Orange','Yellow','Blue violet'};
                system.debug(myList.size()); 
 newList=new set<string>();
        newList.addAll(myList);
        system.debug(newList);
}
Here is my program:

public class Outbound_Example_3 {
    public void invoke(){
        Messaging.SingleEmailMessage msg =new Messaging.SingleEmailMessage();
        Contact con=[select id ,AccountId from Contact where createdDate=TODAY];
        msg.setTargetObjectId(con.Id);
        msg.setWhatId(con.AccountId);
        EmailTemplate et =[select id from EmailTemplate where name='Case Response'];
        msg.setTemplateId(et.id);
        
        Document doc =[select id,Name,Body,ContentType ,Type from Document where name='Email Messaging'];
        Messaging.EmailFileAttachment eft1 =new Messaging.EmailFileAttachment();
        eft1.setFileName(doc.Name+doc.type);
        eft1.setBody(doc.body);
        eft1.setContentType(doc.ContentType);
        
        PageReference p=Page.EmailSerc;
        Blob body=p.getContentAsPDF();
        Messaging.EmailFileAttachment eft2 =new Messaging.EmailFileAttachment();
        eft2.setFileName('EmailSerc');
        eft2.setBody(body);
        List<Messaging.EmailFileAttachment> files =new List<Messaging.EmailFileAttachment>{eft1,eft2};
        msg.setFileAttachments(files);
        Messaging.Email[] emails =new Messaging.Email[]{msg};
        Messaging.sendEmail(emails);    
        
    }
}


Outbound_Example_3 ou=new Outbound_Example_3();
ou.invoke();


Please let me know where am I going wrong.
Thanks!
Hello,

I am a 'Ranger' now and I want to know when will I get my hoodie !!!

 
My question is: When ever lead is inserted, with leadsource as web set wilson as owner of record. If the leadsource is other than web then assign it to lifeQueue as owner.

Ans:

public class Lead_Example {
    
    User u= [Select id from User where FirstName LIKE 'wilson'];
    group g= [Select id from Group where type='Queue' and name='LifeQueue'];
    public static void callMe(List<Lead> leads) 
    {
        for(Lead l: leads)
        {
            if(l.LeadSource=='web')
            {
                l.OwnerId= u.id;
            }else{
                l.OwnerId=g.id;
            }
        }
    }
}

Trigger Callout:
trigger Lead_Example on Lead (before insert) {
    List<Lead> leads=Trigger.new;
    
    Lead_Example.callMe(Trigger.new);
    
}
I properly installed CLI. In a command window, I enter:

sfdx force:auth:web:login -d -a DevHub

in order to log in to the trial Dev Hub that I created. The aforementioned command opens the Salesforce login page in the web browser, so I log in using my Developer Hub Trial Org credentials and click Allow. After that, web browser show me an error: "This site can't be reached. localhost took too long to respond".

This is the URL that Salesforce use after I authenticate in the browser: http://localhost:1717/OauthRedirect?code=aPrxbOND3gL_2LbSR7rKPdvD0XBVk2YpErl3pphY2f3xvZ1wf5SSPJByDleRLPMtzCQWnNGAdg%3D%3D&state=f2f8254fac23

I don't know what happen.

User-added image

User-added image

User-added image