• Troy Center
  • 30 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
  • 22

Hi Everyone!

Am new to slaesforce and Am trying to learn apex. 

Can anyone breakdown the following..



Schema  --> is a class 
SObjectType--> Am guessing it is an inner class
Event--> I understand this can be any object api name but how does that translate to apex? how are we able to call an object name on class? is it because that the object name is a variable inside the inner class?
getRecordTypeInfosByName() --> I guess it is a method inside the inner class
get(Label.RecordTypeName) --> another method but how are we able to call method from a method? method1().method2()??
getRecordTypeId(); --> another method???

Am pretty new to oops(apex) and would like to know how they are internally structure for the way the calls are happeining in the above statement?
can any one explain please.

Thanks in advance!

Failed to save customLookup.cmp: Invalid definition for null:customLookUpController: ApexService.getType() return null with currentNamespace: c, namespace: null, name: customLookUpController: Source
Kill the process running on port 1717 or use a custom connected app and update OauthLocalPort in the sfdx-project.json file.
Hi All,

I am trying to authorize an org (Dev org not sandbox) from VS Code and I am in my Company network and default port Id 1717 wouldnt work for me. I have followed the below steps to create a Connected App and change port number in sfdx-project.json file. But still its taking me to old 1717 localhost even after changin the port number.

From Connected App..
User-added image

From VSCode project setup..

User-added image

I have also tried to put 443 in the redirected URL instead of 1717. But it doesnt work either.

Is there any mistake that I have done while setting up the Conncted App ? BTW, I am not using JWT AUthentication. Its just web based authentication. How else can I change the default port number ?

PS : I have used both "oauthLocalPort" : "443" and "oauthLocalPort" : 443. 
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
Hi everyone, How can I pass string to lightning search?
Is there a way similar to classic where we can pass a string instead of typing the search keyword? 
If there is any solution let me know. Our clients wants to do it in lightning instead of classic. 

Thank you.

Hi guys, is there a global search in Lightning similar to Classic that use &startURL=/_ui/search/ui/UnifiedSearchResults?str=valueToSearch ?.
If you know something please let me know. Thank you.

I have been going through this code for an hour now and cannot figure out why it is an "Illegal Assignment from String to List". Isn't an Email field a string?

The error is shown at the line I flagged, however the error might be somewhere else in my code too.
public class sendEmail {
    public String subject { get; set; }
    public String body { get; set; }
    private final <Object> WebInquiry;
    // Create a constructor that populates the Account object
    public sendEmail() {
        WebInquiry = [SELECT Email__c FROM <Object> WHERE id = :ApexPages.currentPage().getParameters().get('id')];
    public <Object> getWebInq() {
        return WebInquiry;

    public PageReference send(){
        // Define the email
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
String address;
        address = WebInquiry.Email__c;

****ERROR HERE****        String[] toAddresses = address;
        // Sets the paramaters of the email
        email.setSubject( subject );
        email.setToAddresses( toAddresses );
        email.setPlainTextBody( body );
        // Sends the email
        Messaging.SendEmailResult [] r =
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});  
        return null;


Thanks for your help!
the challenge is as follows :

Create a camping component that contains a campingHeader and a campingList component.
1.The campingList component contains an ordered list of camping supplies that include Bug Spray, Bear Repellant, and Goat Food.
2.The campingHeader component contains an H1 heading style with a font size of 18 points and displays 'Camping List'.

so i made a lightening application named "camping.app" having code :

<aura:application >

where lightening component "campingHeader.cmp" having code :

<aura:component >
    <h1> Camping List </h1>

for I have "campingHeader.css" having code :

h1.THIS {
    font-size: 18px;

and lightening component "campingList.cmp" having code :

<aura:component >
       <li>Bug Spray</li>
       <li>Bear Repellant</li>
       <li>Goat Food</li>      

when i preview the application it is working nice; but when checking the challenge it says :
"Challenge Not yet complete... here's what's wrong: 
The 'camping' Lightning Component does not include either the campingHeader or campingList component."

please help me know where I m doing wrong. Thanx waiting for your reply
Hi Anybody, who took the TrailHead. Visual Workflow challange, I am not able to change the close date of the Opportunity by adding 30 days to it.

{!$Flow.CurrentDate} + 30 does not let me save.

thanks in Advance
I want to initiate a Flow from a button on a Custom Object.  How do I capture the ID of that Custom Object record and be able to use it in the Flow?

I have written a fucntionality to convert lead to case. The only problem is I have a field on Lead as Web-to-Lead Notes which is Text Area long and that is being popualated on Case Subject on Conversion. It gives error if the length is big. So I need to truncate the length of Lead to Web Notes field to 50 to properly fit in the Case Subject. Please help. Here is my code VFP and Apex:

Visualforce Page:
<apex:page standardController="Lead" extensions="CaseConverter">
    <apex:form >
        <apex:pageBlock title="Convert information to a new Case.">
            <apex:pageBlockButtons >
                <apex:commandbutton action="{!createCase}" value="Finish"/>
                <apex:commandbutton action="{!returnToLead}" value="Previous"/>
            <apex:pageBlockSection title="Lead content Section">            
                <tr><th class="labelCol vfLabelColTextWrap " scope="row">Lead Record Type</th><td class="dataCol "><span id="j_id0:j_id1:j_id2:j_id6:nameId">{!recordTypeName}</span></td></tr>
                <apex:outputText value="{!lead.Web_To_Lead_Notes__c} " rendered="true"/>
                <apex:outputField value="{!lead.Name}" id="nameId"/>
                <apex:outputField value="{!lead.Company}" id="companyId"/>
                <apex:outputField value="{!lead.Phone}" id="phoneid"/>
                <apex:outputField value="{!lead.City}" id="cityId"/>
                <apex:outputField value="{!lead.Street}" id="streetId"/>
                <apex:outputField value="{!lead.Country}" id="countryid"/>
                <apex:outputField value="{!lead.Email}" id="emailid"/>
                <apex:outputField value="{!lead.PostalCode}" id="postalId"/>
                <apex:outputField value="{!lead.MobilePhone}" id="mobileId"/>
                <apex:outputField value="{!lead.Website}" id="websiteId"/>
                <apex:outputField value="{!lead.Description}" id="descriptionId"/>
                <apex:outputField value="{!lead.Industry}" id="industryId"/>                           
   Apex Class:
public with sharing class CaseConverter {
    public Lead curLead{set;get;}
    private final String name;
    private final String company;
    private final String phone;
    private final String city;
    private final String street;
    private final String country;
    private final String email;
    private final String postal;
    private final String mobile;
    private final String website;
    private final String description;
    private final String industry;
    private final String leadId;
    public String Web_To_Lead_Notes_Case;
    public string accountOwnerId;
    //getter,setter for the selected list values
    public String statusCaseSelected{get;set;}
    public String originSelected{get;set;}
    //getter,setter for the input fields
    public String subjectInput{get;set;}
    //getter,setter for the input fields
    public String recordTypeName{get;set;}
    //getter setter for the checkboxes
    public Boolean createAccount{get;set;}
    /*get the select options from the case system schema for the status field
    * Input: nothing
    * Output: List of the select options from case status
    public List<Selectoption> getStatusCaseItems(){
        List<Selectoption> statusValues = new List<Selectoption>();
        Schema.Describefieldresult systemCaseStatus = Case.Status.getDescribe();
        for(Schema.Picklistentry plEntry : systemCaseStatus.getPicklistValues()){
                new Selectoption(
        return statusValues;
    /*get the select options from the case system schema for the origin field
    * Input: nothing
    * Output: List of the select options from case origin
    public List<Selectoption> getOriginItems(){
        List<Selectoption> originValues = new List<Selectoption>();
                       new Selectoption(
                                'Customer Service','Customer Service'
        return originValues;

    //constructor, this page will be called from the LeadToCase Page
    public CaseConverter(ApexPages.StandardController controller) {
        this.curLead= (Lead)controller.getRecord();
        List<QueueSobject> lstQueues = [SELECT Id,queue.Name, QueueId FROM QueueSobject WHERE SobjectType = 'Case'and queue.Name = 'Customer Service Cases'];
        curLead.OwnerId = lstQueues[0].QueueId;
        List<recordType> recordTypeList = [select Name from recordType where Id = :curlead.recordTypeId];
        if(recordTypeList.Size() > 0 ) {
            recordTypeName = recordTypeList[0].Name;
        this.name = curLead.FirstName + ' ' + curLead.LastName;
        this.company = curLead.Company;
        this.phone = curLead.Phone;
        this.city = curLead.City;
        this.street = curLead.Street;
        this.country = curLead.Country;
        this.email = curLead.Email;
        this.postal = curLead.PostalCode;
        this.mobile = curLead.MobilePhone;
        this.website = curLead.Website;
        this.description = curLead.Description;
        this.industry = curLead.Industry;
        this.leadId = curLead.Id; 
        this.Web_To_Lead_Notes_Case = curLead.Web_To_Lead_Notes__c;
        subjectInput = curLead.Web_To_Lead_Notes__c; 
  • April 03, 2015
  • Like
  • 0
I want to display current date  on a  field. i have writtened in formulae editor
which results error and i have tried 
$System.OriginDateTime. but even getting wrong date.

I want to use record Type to limit trigger action. 


Now I use querey to get it my code liks below

string Id = [SELECT id from RecordType where Name ='Someone'].Id;


I also found this page, we could use method to get the Record Type Id to avoid the query.

I still can't understand it.


Is there some simple and easy wayt to get the ID only by Record Type's Name?



Can anyone please let me know why is this checkbox 'Starts with a vowel sound' is used while creating objects in salesforce?


I read somewhere that 'This is used for languages where words need different treatment depending on the first character'.


If anyone can explain me with example on how it works that would be great.


Thanks in advance

Priya Nair

  • April 26, 2010
  • Like
  • 0
Hi,  wondered if anyone could help determine why my Return URL is not working on a custom button.
The above related to a new custom object related to the opportunity, on saving I would like it to return back to the opportunity.   I have tried lots of different options, even sending it to an external website to see what happens, but everytime it just takes me to the saved new record.
Is this not possible to do with custom objects, same code "retURL" works on custom event buttons.
Thanks for any assistance
I want to initiate a Flow from a button on a Custom Object.  How do I capture the ID of that Custom Object record and be able to use it in the Flow?