+ Start a Discussion
Darren DoudDarren Doud 
I am working on a Trailhead Challenge and receive this error when I execute.

User-added image

Create an Apex class that returns contacts based on incoming parameters.

For this challenge, you will need to create a class that has a method accepting two strings. The method searches for contacts that have a last name matching the first string and a mailing postal code (API name: MailingPostalCode) matching the second. It gets the ID and Name of those contacts and returns them.The Apex class must be called 'ContactSearch' and be in the public scope.
The Apex class must have a public static method called 'searchForContacts'.
The 'searchForContacts' method must accept two incoming strings as parameters, find any contact that has a last name matching the first, and mailing postal code matching the second string. The method should return a list of Contact records with at least the ID and Name fields.
The return type for 'searchForContacts' must be 'List<Contact>'.

Here's my code:

User-added image

Can someone assist me? Please.

Thank you,
Darren
Best Answer chosen by Darren Doud
ShotShot
Thats because you are trying to write your code in anonymous window.
In dev console click File - New Apex Class and write there your code.
Minkesh JAHERALYMinkesh JAHERALY 
Hello,
I tried many times... but receive the same error message : "Challenge Not yet complete... here's what's wrong: 
Formula in custom field 'Account Annual Revenue' is not correct. Check the instructions."
I followed all instructions & get the right results. It's a basic & very simple formula.
Do someone else encounter the same issue ? Any solution ?
Best Answer chosen by Minkesh JAHERALY
Minkesh JAHERALYMinkesh JAHERALY
I created a new Trailhead playground... entered exactly the same formula... and finaly could validated the challenge
Elysian Force SolutionsElysian Force Solutions 
Hi guys, 

I am getting an error on challenge 3 (reports and dashboards) of the Business Admin Specialist superbadge. I used a brand new playground for this superbadge but I am getting an error which suggest I havent with error code: ZGREYDBI.

Can anyone help?

Thanks,
Craig 
Best Answer chosen by Elysian Force Solutions
SandhyaSandhya (Salesforce Developers) 
Hi,

This error may occur if you have changed something in your report and did not refresh you dashboard.I would suggest you refresh your dasboard every time you make any changes in your report.

Refer below link for more information on this.

https://developer.salesforce.com/forums/?id=9060G000000MSN2QAO

Hope this helps you, if this helps you, please mark it as solved so that it will be avaialble for others as a solution.

Best Regards,
Sandhya
Samuel Burden 5Samuel Burden 5 
In the Sales Wave App module, specifically Creating Sales Wave Using the Wizard, there is a step where you use the Trailhead Data Manager to download the dataflow. Whenever I click on Download Trailhead Dataflow I receive the message "No SalesWave App found" and therefore I am not able to select my app. The app was created yesterday but still no luck. Any suggestions?
Best Answer chosen by Samuel Burden 5
Samuel Burden 5Samuel Burden 5
I resolved my issue. I'm using 'My Domain' in my wave dev org and apparently if you access the Trailhead Data Manager using your custom domain it will not work. I accessed it without my custom domain and the sales wave app is showing as expected.
Patrick McClellanPatrick McClellan 
I'm working hard to understand the range of automation tools. Salesforce makes it really confusing with their lack of consistent naming, and with the inevitable tool updates/replacements while supporting the legacy versions. 

Yes, I have read "Which Automation Tool Do I Use?". It's helpful, but lacks the candid insights I'm hoping to get from your feedback. They tell you what's possible, like invoking an approval process from within a Process Builder process, but they don't explain WHY you might want to do it that way. There are other posts out there comparing various tools, but I'm not clear on the timeline of tool launches and updates, so reading a post from 2015 might have been accurate then, but now...?

Here's what I understand, with questions in italics. I welcome your insights and corrections.

Approval Processes: simple but capable process automation around approvals. An approval process allows specification of the approvers, and specific steps that will occur when approved or rejected -- typically including locking or unlocking the record for edits, and updating fields such as opportunity stage. Approval processes can be triggered through a button click or link, or through a criteria such as a field update to a particular value (such as stage = "submit for approval"). They can also be invoked from Process Builder Flows or Workflow Rules, though it's unclear to me why you'd want to do this instead of using the entry criteria. And if you intend to invoke the approval from a Flow or Workflow, what do you set for the entry criteria that wouldn't fire on its own?

User-added image


Workflow Rules: accessed in Setup as "Workflow Rules", and setup using a form interface very similar to the Approval Processes. From what I can understand, this tool continues to exist because there are lots of legacy workflow rules in use. However, for new rules, they seem to be pushing us toward using Process Builder, with its drag-n-drop visual interface and additional capabilities.  Right?

User-added image

Process Builder: (aka "Lightning Process Builder"), accessible in Setup as "Process Builder", and what you create are called "Processes". Seems to be the automation tool of choice when you don't need user input, but you want things to happen automatically behind the scenes. Replaces Workflow Rules.

This is a very capable tool, able to evaluate multiple criteria and perform multiple actions in specified sequence. You can collect a whole series of criteria/actions within a single process, or you can call invoke a separate process from the one you're creating. I'm not clear why you'd want to gang them all together, other than to control the sequence of the processes. Otherwise, discrete component processes seems easier to create, test, and debug. Any insights here?

User-added image

Visual Workflows, accessible in Setup as "Flows". <rant> If they're replacing Workflow Rules with Process Builder Processes, it's damn annoying that they call THIS tool Visual Workflows and the outputs are "Flows". </rant>

This is the most capable of the automation tools, specifically useful for user interaction. These flows aren't tied to a specific Object, so they can CRED on any object. They are typically triggered by user interaction. Although the record lookup, loops, use of variables, text formatting, etc., are cool features, I'm frustrated by lack of comprehensive training on it. For example, I want to create a dynamic screen interface (number of input fields corresponds to a lookup value) -- can't find any documentation, but it seems like an common need.

User-added image

OK, thanks for making it this far in the post. I welcome your insights.



 
Best Answer chosen by Patrick McClellan
Patrick McClellanPatrick McClellan
I'll mention that the Platform App Builder certification test asks a lot of questions about which tool to use for what, which has prompted this thread. If you have any quick reference rules of thumb, please share. I'll start that list here, please add to it.
  1. Needs user interaction: Visual Workflows -- the only tool that allows user interaction.
  2. Typical record approval: Approval Processes -- use the simplest tool if it meets the need.
HARSH saini 6HARSH saini 6 
trigger trigger52 on India__c (after insert) {
  list<san_francisco__c> con =new list<san_francisco__c>();  

    for(India__c h : trigger.new){
     san_francisco__c s = new san_francisco__c();
      s.Name=h.Name;
        s.Company__c=h.Company__c;
        s.Mobile__c=h.Mobile__c;
           s.Email__c=h.Email__c;
        con.add(s);
        
        
    }
    insert con;
}
Best Answer chosen by HARSH saini 6
Sitanshu TripathiSitanshu Tripathi
Dear Harsh,

I'm telling you only Way from this link.
Create Test class from yourself.

https://sitanshusfdc.blogspot.in/2018/02/apex-trigger-with-helper-class-and-test.html
Elias RollenElias Rollen 

I am a newbie in this technology, I want to became a Salesforce/force.com Developer, and for that I am started to learning from official Salesforce documentations, But I am just confused where I have to start there are so many things are there and I couldn't find out which thing I have to learn first and then step by step I get proficiency in all modules of Saleforce/force.com. There are various things which I had seen like Objects, classes, Apex, visualforce, SOSL, SOQL, triggers, and many other things, But i am just confused to start from where when I am start to learn anything then I got confused when some other thing will comes in that, like apex comes in the Visualforce, So then I started to learn Apex first then I got anything else, So I am just running here and there to pickup the topics, Please help me that how can I start and then follows all the topics in a step by step manner so I learn everything and no topic will be left.

Please help with me... I am really confused.

Thanks! Elias

Best Answer chosen by Admin (Salesforce Developers) 
Satish_SFDCSatish_SFDC
You are right. Stick with Apex for now.
Visualforce also uses Apex for controllers etc. So it makes sense to finish off Apex first and then go on to other topics.

Hope this helps.

Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.

Regards,
Satish Kumar
Terry PostTerry Post 
Step 7 - Synchronize Salesforce project data with Square Peg's external billing system

I'm getting an error message when triggering the SOAP call from the UI via record update:

System.CalloutException: IO Exception: External server did not return any content

When I import the WSDL into SOAP UI and send the same package body, I receive this message:
HTTP/1.1 500 
Server: Cowboy
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 10 Jul 2017 17:58:08 GMT
Via: 1.1 vegur
Proxy-Connection: Keep-Alive
Connection: Keep-Alive

{"timestamp":1499709488068,"status":500,"error":"Internal Server Error","exception":"java.lang.OutOfMemoryError","message":"unable to create new native thread","path":"/ws"}

Does this mean that the herokuapp needs to be restarted or something? I've found a couple of posts with sample code for this challenge and with a few small differences, mine matches from what I can tell. Here's the code I'm using:

ProjectTrigger
trigger ProjectTrigger on Project__c (after update) {
    //Call the Billing Service callout logic here

    if (trigger.isAfter && trigger.isUpdate) {
        BillingCalloutService.callBillingService(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap);
    }

}

BillingCalloutService
public class BillingCalloutService {
    //Implement business and callout logic methods here
    public static void callBillingService(List<Project__c> newList, Map<Id, Project__c> newMap,
            List<Project__c> oldList, Map<Id, Project__c> oldMap) {

        if(!newList.isEmpty()) {
            Project__c project = newList[0];
            if (project.Status__c == 'Billable' && oldMap.get(project.Id).Status__c != 'Billable') {
                // Get Service Credentials from custom settings
                ServiceCredentials__c credentials = ServiceCredentials__c.getInstance('BillingServiceCredential');
                billProject(project.ProjectRef__c, project.Billable_Amount__c, credentials.Username__c, credentials.Password__c);
            }
        }
    }

    @Future(callout=true)
    private static void billProject(String projectRef, Decimal billAmount, String username, String password) {

        BillingServiceProxy.project project = new BillingServiceProxy.project();
        project.projectRef = projectRef;
        project.billAmount = billAmount;
        project.username = username;
        project.password = password;

        BillingServiceProxy.InvoicesPortSoap11 invoiceCall = new BillingServiceProxy.InvoicesPortSoap11();
        // Make the callout and update the Status if callout is successful
        String response = invoiceCall.billProject(project);

        List<Project__c> projects = new List<Project__c>();
        if(response != null && response.equalsIgnoreCase('OK')) {

            projects = [
                    Select Id, Status__c
                    From Project__c
                    Where ProjectRef__c = :projectRef
            ];
            if(!projects.isEmpty()) {
                projects[0].Status__c = 'Billed';
                update projects;
            }
        }

    }
}

BillingServiceProxy
//Generated by wsdl2apex

public class BillingServiceProxy {
    public class billProjectRequest_element {
        public BillingServiceProxy.project project;
        private String[] project_type_info = new String[]{'project','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'project'};
    }
    public class project {
        public String username;
        public String password;
        public String projectRef;
        public Double billAmount;
        private String[] username_type_info = new String[]{'username','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] password_type_info = new String[]{'password','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] projectRef_type_info = new String[]{'projectRef','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] billAmount_type_info = new String[]{'billAmount','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','projectRef','billAmount'};
    }
    public class billProjectResponse_element {
        public String status;
        private String[] status_type_info = new String[]{'status','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'status'};
    }
    public class InvoicesPortSoap11 {
        public String endpoint_x = 'http://sb-integration-bs.herokuapp.com:80/ws';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://salesforce.com/th/invoice-web-service', 'BillingServiceProxy'};
        public String billProject(BillingServiceProxy.project project) {
            BillingServiceProxy.billProjectRequest_element request_x = new BillingServiceProxy.billProjectRequest_element();
            request_x.project = project;
            BillingServiceProxy.billProjectResponse_element response_x;
            Map<String, BillingServiceProxy.billProjectResponse_element> response_map_x = new Map<String, BillingServiceProxy.billProjectResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://salesforce.com/th/invoice-web-service',
              'billProjectRequest',
              'http://salesforce.com/th/invoice-web-service',
              'billProjectResponse',
              'BillingServiceProxy.billProjectResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.status;
        }
    }
}

Any ideas what I'm doing wrong here? Any assistance would be most appreciated!

Thanks!



 
Best Answer chosen by Terry Post
Madison Rawles 2Madison Rawles 2
Just wanted to let you know that I tried to complete step 7 today without making any changes and it worked, so it was likely their end.
Mitesh SuraMitesh Sura 
We have API connection with external system. They cannot use same session and hence will be requesting new session (previous session will still be active) each time they connect with Salesforce.

Can someone please explain:
- What happens to previous sessions?
- Do they expire automatically after 120 minutes?
- At a given time, how many active session there can be?
- What are the implications of multiple open sessions at given point in time? 

regards
Mitesh
Best Answer chosen by Mitesh Sura
Daniel BallingerDaniel Ballinger
How your sessions respond will depend on how they are being created. For example, if you are using the SOAP API to call login() with the same credentials from a single device, you will likely get the same session Id back. Beware of calling logout() here, as you will end both (being the same session).

I've seen reports (http://salesforce.stackexchange.com/a/1464/102) that doing the same with OAuth from different devices yeilds distinct sessions.

Expiry time will be controlled by the configuration. Default is 120 minutes after last activity, but this can be changed.

The limiting factor in terms of usage will be the Concurrent API Request Limit (https://help.salesforce.com/HTViewHelpDoc?id=integrate_api_rate_limiting.htm). E.g. With a developer edition org you can only have 5 active long running requests. There are other limits that will also come into play, such as the SOQL querylocator. See Execution Governors and Limits (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm).

I'd suggest you run a small trial to see how it behaves with your setup. You can monitor your active sessions with the User Session Information page. (https://help.salesforce.com/htviewhelpdoc?id=security_user_session_info.htm&siteLang=en_US)
 
Przemysław TamońPrzemysław Tamoń 
Hello,

I'm doing a 'Visualforce Basics' module and I'm stuck at 'Use Standard Controllers' Unit (link here).
I created a page with the following code:
 
<apex:page>
    <apex:pageBlock title="Account Summary">
        <apex:pageBlockSection>

        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

Then I opened a page via the "Preview" button in a Developer Console and opened a JavaScript console in Chrome where I typed:

$A.get("e.force:navigateToURL").setParams({"url": "/apex/AccSum"}).fire();
And I got the following error:
Uncaught ReferenceError: $A is not defined at <anonymous>:1:1
 

Both the snippets are copied from the Unit's sections, I didn't change anything except the page's name - 'AccSum'. I tried all of the above in a Firefox which also did not work.

Does anyone know what's going on?

Best Answer chosen by Przemysław Tamoń
ReidCReidC
Interestingly, I was able to reproduce the "$A is not defined" error when I open the JavaScript console from the Salesforce Developer Console. As I re-read the instructions, I would say that they aren't clear that you need to return to the Lightning Experience and then open your JavaScript console, instead of doing it from the Salesforce Developer Console.  I'll open a bug against the module.