1

As this is my first step to learn SFDC. I am stuck with a question at the first step itself. As I was going through video lessons and I am unable to understand how this works as Lead field does not contain FirstName and LastName fields (Under setup).

Also, when i checked the fields in Build>Leads>Field section i can see First Name (with space) and Last Name( with space) under Salutation field. Then how come salesforce trigger is updating name field when the trigger says l.FirstName = 'this'; Please help me understand as i have already spent 2 hours searching for above details :(

    trigger HelloWorld on Lead (before Update) {
      for (Lead l : Trigger.new){

        l.FirstName = 'hello';
        l.LastName = 'world';
    }

}
3

The Object viewer UI does not show actual API Names for certian fields on certain standard object. Lead being one of them,

enter image description here

If you want to see actual API names, Open Developer Console->Open -> Lead.obj , it displays a table for APINames of the field that you can use in your code.

enter image description here

A field has 2 main Attributes, 1 Label , and 1 API Name.

Label can have spaces, API_Names cannot. API Name is used everywhere in code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.