Salesforce coding lessons for the 99%
Finally, Apex tutorials for point-and-click admins! Written by a self-taught Google engineer.
  • Beginner Tutorials
    • Apex
    • Certifications
    • Career Info
    • Technical Architect
    • Visualforce
    • Videos
  • Apex Academy
  • Success Stories
  • About Me
  • Misc
    • Mailbag
    • Challenges
    • Links
    • Login to my Org
Follow @dvdkliuor SUBSCRIBE!

Login to SFDC99

May 16, 2013

The best way to learn how to code is to do it in your own org!

That said, you might be lazy like me and just want to be spoon fed everything.

Login URL: https://login.salesforce.com
Username: learn@sfdc99.com
Password: resetMyLife!
Security token: AXTzUtXM64IfdWM40IEBuuuar

All code samples and data models from this site can be found in the Sfdc99 Salesforce org!
Please feel free to create and edit records to your heart’s content – Sfdc99 is our playground!

234 Comments
Pooja
July 26, 2022 @ 12:20 pm

Hi David

I am trying to use below code for user login into the application but I am getting exception ”common.apex.runtime.impl.ExecutionException: Attempt to de-reference a null object”.

public static String login(String username, String password, String startUrl) {

try{
system.debug(username);
system.debug(password);

ApexPages.PageReference lgn = Site.login(username, password, startUrl);
System.Debug(‘logincontroller’);
return lgn.getUrl();
}
catch (Exception ex) {
return ex.getMessage();
}

}

Also how can I validate username and password in the same code?

Reply
max
May 16, 2022 @ 5:39 am

hii david

Looks like the credentials aren’t working now.

Reply
    David Liu
    May 17, 2022 @ 9:16 pm

    Updated!

    Reply
Swarnil
April 20, 2021 @ 8:46 am

Hi David,

I really want to know, how I can create the credential and share with my blog readers so that they don’t change an email or anything.

Reply
David Storey
September 23, 2020 @ 2:19 pm

Hey David – David here!!

cannot get past the errors in the Hello World apex trigger. I’ve got 9

trigger HelloWorld on Lead (before update) {
for (Lead 1 : Trigger.new) {
1.FirstName = ‘Hello’;
1.LastName = ‘World’;
}
}

Gives this for line 3
Unrecognized symbol ‘f’, which is not a valid Apex identifier.

Gives me this on line 2
Expecting ‘)’ but was: ‘:’

And then 7 more very similar. This is in my own developer org. Can’t say I’m not deflated as I’ve deleted and recreated 5 or more times now. Why am I getting these errors?

Thanks – David

Reply
    David Storey
    September 23, 2020 @ 3:16 pm

    Sorry – has been resolved

    Reply
Femi
June 30, 2020 @ 8:59 am

Hi David,

Thank you for providing us with your credentials. Once i’m logged in, I’m not sure where to go next. Just want to write my first trigger!

Reply
    David Liu
    June 30, 2020 @ 9:08 am

    Hey Femi you’ll want to create your own org here! https://developer.salesforce.com/signup

    Reply
AV
October 17, 2019 @ 10:19 pm

David I am not able to login to salesforce using the credentials given.

Reply
    David Liu
    October 30, 2019 @ 9:22 pm

    Updated =)

    Reply
Srinath
October 3, 2019 @ 2:47 pm

Hi David,

I am having trouble logging into your org. Can you please share the credentials via srinath4sfdc@gmail.com

Reply
Mohan
July 29, 2019 @ 12:12 am

Hi David,
‘learn@sfdc99.com’ for this user access is very less can’t create a class also.. can i have other user access so i can practice more on your Org please !!! provide the access of other user

Thanks in Advance

Reply
clcik here
May 20, 2019 @ 9:32 pm

I have started to learn salesforce development from sfdc99 tutorials , it has awesome contents which I found best till now, I am thankful to the team who all have given the stuffs.

Reply
megha
April 15, 2019 @ 10:45 pm

need updated credentials

Reply
    David Liu
    April 15, 2019 @ 11:15 pm

    Done!

    Reply
      Hari
      May 12, 2019 @ 8:06 am

      Mr David,

      send your updated credencial to log into your org.
      It will be more helpful to me if you give me

      Reply
        David Liu
        May 18, 2019 @ 11:13 am

        Updated! Thank you Hari!

        Reply
          Hari
          May 25, 2019 @ 4:16 am

          Bro I just want to talk with you about salesforce can you please help me bro.
          its about my future bro
          plz give me a wats app msg-8883555311.

          Reply
      Venkatesh
      July 24, 2019 @ 11:17 am

      David, You should may be create an installable package? Do you need help, I can do that for you.

      Reply
Jason Roberts
March 11, 2019 @ 6:01 am

Hi David,

I’ve tried twice to log into your org and received: Please check your username and password. If you still can’t log in, contact your Salesforce administrator.

Reply
Ankit rawat
February 16, 2019 @ 10:03 pm

Hi David, I’m just new in Salesforce. Theoretically, I’m good at admin and development as well. But I’m not logically good in the apex programming. Can you tell me how can I develop my logical skill?. What is the best way of practicing Apex coding?. If you have some basic assignments with the solutions please share on my email id (ankitrawat94@gmail.com)

Thanks in advance.

Reply
    David Liu
    February 22, 2019 @ 9:10 pm

    Check this out!

    bit.ly/go-apex

    Reply
Anonymous
December 28, 2018 @ 11:43 pm

Hi,

I have started to learn salesforce development from sfdc99 tutorials , it has awesome contents which I found best till now, I am thankful to the team who all have given the stuffs.

Reply
charlton
October 25, 2018 @ 12:51 pm

Hi All,

I am on track to learning APEX via pluralsight and of course as I am beginning now, it looks like Joe of MavensMate is stepping away and the tool will no longer be available? What are alternatives and David, what are your thoughts on alternative solutions to MavensMate?

Thanks

Reply
    David Liu
    October 25, 2018 @ 6:45 pm

    Dev console.

    Reply
Silas
October 18, 2018 @ 7:14 pm

Is this still updated for current salesforce devs 2018?

Reply
Taha Syed
August 16, 2018 @ 12:34 pm

Hi David,

we can create a class like below and schedule it to run everyday so that the password resets to default.

public class resetPassword {
public static void marketingUser () {
ID UserId = ‘005f4000002FjYL’;
String Password = ‘neverEverChangeMe’;
system.setPassword(UserId, Password);
}
}

Reply
    David Liu
    August 16, 2018 @ 9:18 pm

    LOL that’s awesome man =)

    Reply
    David Liu
    August 16, 2018 @ 9:18 pm

    What to do about the security token??

    Reply
      Anonymous
      August 17, 2018 @ 7:42 am

      Whenever security token is changed, Salesforce sends an automated email with the token. Let’s use this:
      We can use plugins like Postie, Post by email etc. to Create an automated post (in a specific Category) with the latest Security token email. Then, post the category’s link on this page. We may also want to add the ‘no index’ tag to that category.

      Another way so we dont need the token would be adding IP address range to Setup> Profile> Marketing User> Login IP Ranges> Add IP Ranges
      Then. add 0.0.0.0 to 255.255.255.255

      [ Another thought: Please attribute the automation idea to http://www.syedtaha.com ( ͡° ͜ʖ ͡°) ] Just a thought =) ]

      Reply
Prerana
August 9, 2018 @ 8:15 am

Hi David,

Thanks for the great stuff you have shared here!
I used the above credentials to login to your environment, i was successfully able to log in but i am not able to link it to a new project in Eclipse.
Can you please help me out?

Thank you.

Reply
Rui
June 28, 2018 @ 6:46 am

Hi, David.

The credentials aren’t updated.

Thank you :)

Reply
    David Liu
    June 28, 2018 @ 11:05 pm

    Updated!

    Reply
Gaurav
June 28, 2018 @ 12:39 am

David
Plz share your updated credentials.I am not able to login to your org.

Reply
    David Liu
    June 28, 2018 @ 11:05 pm

    Done!

    Reply
Teena
May 7, 2018 @ 10:22 pm

Hi All,

I have tried deploying apex class and deployment is success but not able to find this apex class in my instance Developer edition

Opportunity_Test
ApexClass

Please can some help on this.

Thanks in Advance

Reply
Angie
December 25, 2017 @ 11:52 pm

David, I am a student. I want codes for trigger but unfortunately I cant login with your credentials.

Please help with the correct password.

Regards
Angie

Reply
    David Liu
    January 1, 2018 @ 12:16 pm

    Updated!

    Reply
      Angie
      January 2, 2018 @ 3:17 am

      Thank you Sir David :*

      Reply
Nishith
December 22, 2017 @ 1:48 am

Please share the working credentials..
thanx..

Reply
    David Liu
    January 1, 2018 @ 12:16 pm

    Done!

    Reply
      Nishith
      January 3, 2018 @ 10:47 pm

      Thank You David..
      But you need to update it again!.
      It’s not working.

      Reply
        David Liu
        January 3, 2018 @ 11:15 pm

        It’s working now =)

        Reply
Thiyagu
December 20, 2017 @ 5:54 am

Hi David,

The credentials do not work still. Could you please reset them?

Reply
    David Liu
    January 1, 2018 @ 12:16 pm

    Done!

    Reply
Deb
December 7, 2017 @ 8:09 am

Hi David

The credentials do not work. Could you please reset them?

Reply
    David Liu
    December 10, 2017 @ 6:46 pm

    Done!

    Reply
      Thiyagu
      December 20, 2017 @ 5:51 am

      The credentials do not work still. Could you please reset them?

      Reply
Anjali
September 22, 2017 @ 11:09 pm

Hi David,
Thanku for Shari credentials,
I have one query, let’s say there is one filed on opportunity as stage when we select stage equals to closed ,another field should become required. Is it possible to implement this requirement on runtime. I mean without using validation rule ?

Reply
    David Liu
    September 24, 2017 @ 5:27 pm

    Possible, but you’d need a custom Visualforce/Lightning page

    Reply
    kk
    October 20, 2017 @ 3:35 am

    using trigger it can be done

    Reply
Deb
June 30, 2017 @ 3:55 am

Hey David,

Wonder if this site is updated and if you would still reply to posts.

I would like to say that for the new generation of sfdc this site is great to begin with. Can we get more of this and maybe have more of coding tutorials of course on this site.

Reply
    David Liu
    June 30, 2017 @ 8:13 pm

    LOL I sure do!

    Reply
Muhammad Usman Khan
April 23, 2017 @ 10:50 pm

Hi David,

You are really a nice help to anyone looking forward to Salesforce knowledge.
SFDC99 is a detailed and comprehensive tool for me.

David, what do you suggest to someone, new to Salesforce and willing to get certificates (Admin, Dev, Sales Cloud, Service Cloud)? I understand that I could use the above given free Salesforce developer edition for practice and learning, but would it be enough. As what I know, the free edition wouldn’t have all the advanced features to explore.

Other thing is, my current organisation doesn’t use Salesforce, and I am planning to be with Salesforce. How easy is it for someone new to Salesforce, get a relevant job/ work so they could further keep improving their skills?

Your kind feedback is highly appreciated.

Reply
    David Liu
    April 23, 2017 @ 11:10 pm

    Hey Muhammad!

    Welcome to the industry!

    Don’t worry, the free edition is plenty enough! I’m often surprised at how many features it has, it always exceeds my expectations and needs!

    As for how to get a job, the best thing you can do is get certified. You don’t need job experience to get tons of certs, so this is your shortcut! Check out this guide:
    https://www.sfdc99.com/ultimate-salesforce-certifications-guide/

    Good luck!
    David

    Reply
Pavan
February 10, 2017 @ 8:34 pm

Hi David,

Is salesforce developer edition is free or does it involve any costs?

Reply
    David Liu
    February 12, 2017 @ 10:06 pm

    100% free =) I have like 100 of them!

    Reply
Anuja
August 2, 2016 @ 4:14 am

Hi Everyone,

I am facing issues while connecting to Mavensmate.It stopped working suddenly.Cannot create any classes or triggers.

Its an access denied error.below is the exact msg:

[Error 5] Access is denied: ‘c:\\users\\admin\\appdata\\local\\temp\\.org.mavens.mavensmate.x6jhr6sc’

Can anyone help with this? I have tried changing the Firewall settings but it wont help. Any help is appreciated!

P.S : Sorry if this is a lame question. I am noob :)

Reply
Boddu Suresh
April 20, 2016 @ 12:30 pm

Hi,.. David

How can i change my User Menu drop down to side by side like displayed on your Org.

Setup help My Profile My settings Developer console Logout

In User interface settings i am not able to change it.

Reply
umesh
March 4, 2016 @ 11:03 pm

Hi David
I have one Visual force login Page
from that i want enter anothe page like i have two field user name and password once i enter if it is corect then i want to access that tab(Similar to login Credintials)

Reply
Anonymous
February 22, 2016 @ 1:54 am

Thank you David…

Reply
Balaji
February 15, 2016 @ 11:52 pm

Credentials not work for me. could you pls check once

Reply
    David Liu
    February 16, 2016 @ 7:06 pm

    Thanks for the heads up – updated!

    Reply
      Andrew
      April 21, 2016 @ 1:58 pm

      Hi Dave, just tried logging into workbench with the learn@sfdc99.com credentials and it looks like its not working – maybe someone changed the password? can you please check?

      Reply
Manav Arora
January 19, 2016 @ 6:13 am

HI David,

I have a text field(Status__C) in Custom object(Communication__c). This field is getting updated from external service.
My requirement is, that whenever Status__c value equals to FAILED, then the image should be displayed with this status, in the same field only.
Or the color of text should be Red.
I don’t want to use any VF page for that.
Any idea how to achieve this by configuration.

Thanks in advance,
Manav

Reply
    David Liu
    January 19, 2016 @ 7:39 pm

    Use a formula field!

    Reply
JBN
January 12, 2016 @ 3:23 am

Hi,
I am new bee in SalesForce from today.Need your help and support to understand salesforce.Kindly share the documents to go through to understand more.

Regards,
JBN

Reply
    David Liu
    January 13, 2016 @ 8:23 pm

    Is this site insufficient so far? =)

    Reply
      Himanshu Atal
      January 16, 2016 @ 6:56 am

      Hi David- Could you please let us know some idea to write test classes for inbound and outbound webservices.

      Reply
        David Liu
        January 16, 2016 @ 12:12 pm

        Check out this doc!
        https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_classes_restful_http_testing.htm

        Reply
Ayushi Sharma
December 23, 2015 @ 10:40 pm

Hi David ,

I am using your org to learn. Thanks for credentials.

Reply
Anonymous
September 28, 2015 @ 11:52 pm

Hi David,

I want to be good in triggers, I knew theoretically but I want to be perfect in Implementation i.e Coding could you please suggest how I can achieve that.

Reply
    David Liu
    October 4, 2015 @ 3:46 pm

    Everything on this site!

    Reply
sachin
September 12, 2015 @ 11:22 am

credentials did not work for me…!

Reply
Carissa
August 21, 2015 @ 1:47 pm

Looks like the credentials aren’t working now

Reply
    David Liu
    August 22, 2015 @ 11:31 pm

    Updated!

    P.S. random person who changed the email address/password: when you change the email address I know who you are!!!

    Reply
      Thunder
      August 31, 2015 @ 4:10 pm

      LOL!! I love it.

      Reply
ravi
July 28, 2015 @ 9:50 pm

Hi David, The user name and Id provided is not working for me.

Reply
    David Liu
    July 31, 2015 @ 9:53 am

    Fixed!

    Reply
Anonymous
July 28, 2015 @ 6:39 am

above credentials are not working anymore. Could you please provide correct details.
Thanks,
Kaushik

Reply
    David Liu
    July 31, 2015 @ 9:57 am

    Fixed!

    Reply
Anonymous
April 29, 2015 @ 4:00 pm

Hi David,

I logged on to your org last night around 9:00 PM 4/28/2015, but am no longer able to logon today. Has there been any change of password or account get locked out?

Reply
Anonymous
April 16, 2015 @ 4:37 am

Hi David, I tried to create a contact record, but the trigger named “CountFriends” seems not working? Please correct me if i’m wrong am just new in create trigger. I can’t see the result. Thanks!

Reply
Ryan
February 20, 2015 @ 3:20 pm

Hi David, The user name and Id provided is not working for me.

Reply
    David Liu
    February 20, 2015 @ 3:42 pm

    It’s working for me – you might want to try again!

    Reply
      Ryan
      February 24, 2015 @ 8:31 pm

      You are right – I did not need to include the security token on the end of the password, this was my error. Thanks David!

      Reply
      Jana
      March 2, 2015 @ 8:30 pm

      Hi David,

      Although I am able to login without using the security token, I am not able to see the deployment options and also not able to login to the workbench using the credentials.

      Am I missing something? Please help.

      Reply
        David Liu
        March 4, 2015 @ 6:34 pm

        I hide those options so the org doesn’t get tampered with too much =)

        Workbench should work though!

        Reply
      gopinath
      July 22, 2015 @ 9:59 pm

      Hi David,This is Gopinath.please provide basic information about sfdc integration i have a knowledge about web services like the following
      1)creating connected app to get the authentication token and post,put patch,delete,get methods

      i have a knowledge like this but the problem is how can i explain to others..? and

      who will do this work means from our saleforce side or who want to access our application those pepole.

      here my main doubt is we are generating authentication token using our username ,password,curl.

      but why we are creating java project and we are making operations from their end and our contact or account..etc are inserting,updating,deletingn actually who will do this work. please explain such things………………………….

      This is my email ids are:::::::: Lgnsfdc@gmail.com , gopilakkimsetti@gmail.com

      Regards
      Gopinath

      Reply
Swami
February 5, 2015 @ 1:43 pm

Nice Story David, learnt something today ! Explains why you reply to most of these. Keep up the Spirit !

Reply
Anitha J J
February 3, 2015 @ 10:35 pm

Hi David,

Anitha from India!!!

Very impressive.. your efforts to help us….Thanks..

Reply
Swami
January 29, 2015 @ 9:54 am

I cant beleive there are folks out there asking David to debug code :) come’on folks – have some respect for other’s time. And David is nice enough to reply to all of them.

Reply
    David Liu
    January 29, 2015 @ 10:16 pm

    Thanks for having my back Swami! I’ve received thousands of messages and yours is the first that ever tried looking at things from my perspective. Thank you, it means a lot to me =)

    This story probably describes my mindset best:

    A young man is walking along the ocean and
    sees a beach on which thousands and thousands
    of starfish have washed ashore. Further along
    he sees an old man, walking slowly and
    stooping often, picking up one starfish after
    another and tossing each one gently into the
    ocean.

    “Why are you throwing starfish into the
    ocean?,” he asks.

    “Because the sun is up and the tide is going out
    and if I don’t throw them further in they will
    die.”

    “But, old man, don’t you realize there are miles
    and miles of beach and starfish all along it!
    You can’t possibly save them all, you can’t even
    save one-tenth of them. In fact, even if you
    work all day, your efforts won’t make any
    difference at all.”

    The old man listened calmly and then bent
    down to pick up another starfish and threw it
    into the sea. “It made a difference to that one.

    Reply
      Anonymous
      February 20, 2015 @ 2:18 am

      We are those Fish David and you are making a big difference in our knowledge.

      Reply
        David Liu
        February 20, 2015 @ 11:19 pm

        Cute!

        Reply
Jay
January 11, 2015 @ 5:25 am

Hi David,I face with some problems with developer console from your account .It has no activate new button and I can’t open new class,new tigger so on

Reply
    David Liu
    January 12, 2015 @ 6:19 pm

    This login is read only in my org =)

    Reply
Dilip
December 10, 2014 @ 11:02 pm

Hi David,

I have written the below VF page and Custom controller.The page was designed to do simple addition and subtraction.

I added Javascript code to the page to validate the fields but it didn’t work for me.

VF page:

Enter A value

Enter B value

{!operation} {!result}

function valid()
{
var na1=document.getElementById(‘{!$Component.firstpage.a1}’);
var na2=document.getElementById(‘{!$Component.firstpage.b1}’);
if(na1==” “&&na2==” “)
{
alert(“Enter A and B values”);
}
if(na1==” “)
{
alert(“please ente A value “);

}
var na2=document.s.pass.value;
if(na2==” “)
{
alert(“please ente B value”);

}
}

{!operation1} {!result}

Custom Controller:

public class Arithmatic_opp
{
private final lead l;
public Arithmatic_opp(ApexPages.StandardController stdController) {
this.l = (lead)stdController.getRecord();
}

public integer A_value{get;set;}
public integer B_value{get;set;}
public integer Result{get;set;}
public string operation{get;set;}
public string operation1{get;set;}

public pagereference subb()
{
result=A_value-B_value;
operation=’Result after performing Subtraction operation’;
return null;
}

public pagereference Add()
{
result=A_value+B_value;
operation1=’Result after performing Addition operation’;
return null;
}
}

The calculations were good.But the validation wasn’t done.
Thanks.

Reply
    David Liu
    December 10, 2014 @ 11:05 pm

    Too much code to debug right now, sorry!! Try our forums or the official ones =)

    Reply
Carl Teterskis
December 4, 2014 @ 6:47 am

Hi David, The user name and Id provided is not working for me.

Reply
    David Liu
    December 4, 2014 @ 9:44 pm

    Updated! Thanks for the heads up!

    Reply
anjani
November 27, 2014 @ 8:00 am

Hi David
HAPPY THANKSGIVING DAY

Can you please Help with this below question & give the correct Answers for it, Little bit confused.
Thank You So Much for everything ,Your Help is very Appreciated.

A Developer attempted to load data into a sandbox environment using the Data Loader GUI. The data fails due to authentication issues.
1.What should the Developer check to diagnose the problem? Choose 2

A) The mapping file
B) The password encryption settings
C) The username
D) The endpoint URL

2.which mechanism allows for authenticated access to a force.com site?
2 answers

a.It is not possible to provide authentication for force.com site
b. an active customer portal
c. an active partner portal
d.setting restricted IP ranges for your site

3. What can cross object formula reference?
A. child object records only
B. Parent object records only
c. Both

4.Hiring manager at UC would like a visual mechanism for determining Review score out liners.
Reviews scores are captured as a custom field on a custom review object and can range from
1- 10. Any review score that is >8 should be highlighted in green . Any review score that is <4
should be highlighted in red.

A. Use conditional highlighting
b. Use custom summary formulas
c.use charts
d.Use matrix reports

5. Which statement is true regarding force.com sites?
choose 3
A. sites can leverage declarative page layouts as web pages
B. sites enables developers to build public, unauthenticated websites
C. Sites are built with VF pages
D.sites leverage data and content in a sf org.

6. Universal Container has built a recruiting application with two custom objects, Job applications
and reviews, that have a master-detail relationship. Users should not be allowed
to delete review records after job application records have been approved.
A. Use workflow to change the page layout to read only
B. remove the delete button from job application page layout.
c. use a validation rule in conjunction with a roll-up-summary field
d. change the interviewer's profile to Read-Only for the review object.

7. . The organization-wide default setting for Accounts is Private. A manager resides above a team in the role hierarchy. The manager wants to share some of the account data with the team.
Which feature can extend the viewing privileges of the team to allow them to see each other’s data? (Choose 2 answers)
A. Report Folder settings
B. Dashboard Running User
C. Report Running User
D. Dashboard Folder settings

8. What is a feature of custom report types? (Choose 2 answers)
A. The ability to create an exception report or anti-join
B. The ability to join related objects within a report
C. The ability to customize report wizard user interface
D. The ability to customize the output layout of a report

9. A developer attempts to load data into the sandbox environment using the Data Loader GUI. The data load fails due to authentication issues.
What should the developer check to diagnose the problem? (Choose 2 answers)
A. The password encryption settings
B. The mapping file
C The endpoint URL
D. The user name

10. . A custom object has an organization-wide default setting of Private with Grant Access Using Hierarchies turned off.
Which users can select the Sharing button on records for that object?
A. The record owner, a user with the System Administrator profile, and a user shared to the record
B. The record owner, a user shared to the record, any user above the record owner in the role hierarchy, and a user with the System Administrator profile
C. Only the record owner and a user with the System Administrator profile
D. The record owner, a user above the record owner in the role hierarchy, and a user with the System Administrator profile

Reply
    David Liu
    November 28, 2014 @ 9:43 pm

    Oh boy too many questions for me, drank too much Guinness to even attempt this!

    Reply
      anjani
      November 29, 2014 @ 7:20 am

      I know its too many! But Can you give me the Alphabetic answers Ex: 1AB ,2B…… \
      Thanks David

      Reply
    Santhosh
    December 22, 2014 @ 8:13 am

    All these are DEV 401 questions. Please check David’s questionnaire in this website.
    1. C,D
    2. B,D
    3. B
    4. A
    5. B,C,D
    6. A
    7. A,B
    8. B,D
    9. C,D (Repeat of 1)
    10.A

    David – you are really awesome !!!

    Reply
EVS Kumr
November 14, 2014 @ 10:39 am

Hi David,

As we know that Salesforce is going to remove Partner Portal concept and introducing the Partner Community by end of 2014. Is there any way/steps for shifting the existing Partner Portal users to Partner Communities.users?

In my current working organization, we are having/maintaining nearly 200 to 300 SF client orgs and each is having minimum of 100 Partner Users. If SF is removing this Partner Portal concept, what about the existing user licenses?

Do we need to buy this Community license again for all the users in each production org?. If this is the case, many organization are suppose to pay a lot of money to retain the user licenses.

I read in some of the sites that says, this Partner Community is one type of user license having more features when compared to Partner Portal license. But in some other sites it says, need to contact SFDC to provision the community licence(Partner and Customer Community) . For existing orgs need to raise a request so that SFDC will provision.

By reading all those I am confused a little. Could you please explain in simple way and also need your suggestions for above mentioned questions.

Thanks & Regards,

EVS Kumr.

Reply
    David Liu
    November 14, 2014 @ 6:37 pm

    I have literally zero experience in this subject so I don’t have any suggestions unfortunately!

    If I were you though I’d give my account manager a call to see what our options are!

    Reply
    EVS Kumr
    November 14, 2014 @ 9:03 pm

    Thanks Liu for your response.

    I completed my Administration Certification (201) recently. And I want to complete Advanced Administration Certification (301) asap. Need some guidance on how to prepare for this and any other study material/links/suggestions that helps me in successfully completing this.

    Thanks & Regards,

    EVS Kumr.

    Reply
      David Liu
      November 14, 2014 @ 10:30 pm

      Check this out!
      https://www.sfdc99.com/2014/10/02/guide-to-passing-all-salesforce-certifications/

      Reply
Manasa
November 13, 2014 @ 9:49 am

HI David,

user name and id that u have provided to us is not working.

Reply
    David Liu
    November 13, 2014 @ 6:55 pm

    Thanks for the heads up – updated!

    Reply
Aditi
November 5, 2014 @ 5:22 am

Hello David.

I’m new to SFDC development, and just got curious, to figure out how is the role/work of a SFDC Admin Different from a SFDV Dev.?

Just like other roles, is a DEV role restricted by the Admin’s? and how much?
or they work parallel?

Appreciate the a detail reply.

Thanks

Reply
    David Liu
    November 5, 2014 @ 6:23 pm

    Developers are usually proficient admins themselves, so they do not work too much directly with admins but rather indirectly since they’re in the same instance.

    A lot of admins however play dual roles as business analysts, sort of the middle person between the business and the developer. In these cases the admins will help guide or project manage a developer as he/she executes =)

    Reply
      Aditi
      November 20, 2014 @ 6:58 am

      Appreciate a quick reply David, thanks.

      David, i came across words like:

      1) 1016 Salesforce/SFDC QA Tester
      2)1014 SFDC Tester

      Seems both a QA roles, but how are they different as I can not see any certification on Testing for SFDC, are they aligned along with the Development or Admin roles?

      thanks

      Reply
        David Liu
        November 20, 2014 @ 8:21 pm

        I rarely see those roles so they could be open ended. Worth trying just to learn!

        Reply
abhishek gupta
November 3, 2014 @ 1:39 am

HI David,

user name and id that u have provided to us is not working

Reply
    David Liu
    November 3, 2014 @ 5:24 pm

    Thanks for letting me know – updated!
    https://www.sfdc99.com/login-to-sfdc99/

    Reply
Krishna
October 31, 2014 @ 3:34 am

hi David,
Can you give some tips for following

1) How to insert data into salesforce object from a url whose response is in JSON format.

Reply
    David Liu
    October 31, 2014 @ 6:10 am

    Start here =)
    https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST

    Reply
Vince Chen
October 28, 2014 @ 7:23 am

Just started to learn coding in salesforce and saw ur site and youtube. Excellent job, i will follow thru your tutorials. =P

Reply
Donald "Delta" Bohrisch
October 23, 2014 @ 2:25 pm

First post since I took David’s Apex triggers for Admins class(Anyone Can Code) at DreamForce this year and decided to come back and try my first one for our Org.
Since we have taken away the right to create Accounts from our Users due to Org cleanliness I am creating a new Object, Account Creation Request, to allow them to “create” accounts so that we can view them before converting them into our Org.
My first Trigger after getting back from class is as follows… can yall please check it out and critique as needed :) ?

trigger newAccountRequestConvert on Account_Request__c (after update)
{
if(trigger.isUpdate){
List NewAccountInserted = new List();
for(Account_Request__c acc : trigger.new)
{
if(Account_Request__c.Account_Request_Status__c==’Convert’ && Account_Request__c.Is_this_an_Agency_or_Advertiser__c==’Advertiser’)
{
Account = new Account(
Advertiser_Account_Record =Is_this_an_Agency_or_Advertiser__c
Name =Account_Request__c.Account_Name__c,
Website =Account_Request__c.Website__c,
Contact_Email__c =Account_Request__c.Company_Email__c
Phone =Account_Request__c.Phone__c
TeamMemberRole =Account_Request__c.Account_Team_Role__c
Contact_Name__c =Account_Request__c.Contact_Name__c
Contact_Email__c =Account_Request__c.Contact_Email__c
Contact_Phone__c =Account_Request__c.Contact_Phone_Number__c
}

if(Account_Request__c.Account_Request_Status__c==’Convert’ && Account_Request__c.Is_this_an_Agency_or_Advertiser__c==’Agency’)
{
Account = new Account(
Agency_Account =Is_this_an_Agency_or_Advertiser__c
Name =Account_Request__c.Account_Name__c,
Website =Account_Request__c.Website__c,
Contact_Email__c =Account_Request__c.Company_Email__c
Phone =Account_Request__c.Phone__c
TeamMemberRole =Account_Request__c.Account_Team_Role__c
Contact_Name__c =Account_Request__c.Contact_Name__c
Contact_Email__c =Account_Request__c.Contact_Email__c
Contact_Phone__c =Account_Request__c.Contact_Phone_Number__c
}
}
}
}

Reply
    David Liu
    October 23, 2014 @ 8:12 pm

    Awesome Don!!

    Does the code work as intended? =)

    Also – try testing a case where the code works – then you do another Account update – and see if it still works!

    David

    Reply
      Donald "Delta" Bohrisch
      October 27, 2014 @ 3:41 pm

      G’afternoon David, I havnt been able to test it yet. Unfortunately I can’t even get it to save without continuously giving me errors(which keeps preventing it from saving)… can someone please advise?

      I keep trying to fix it but nothing has allowed me to save it yet.
      Error= Line10 “Method does not exist or incorect signature: [SOBject:Account_Reques__c].RecordTypeId(String)

      trigger newAccountRequestConvert on Account_Request__c (after update)
      {
      if(trigger.isUpdate){
      List NewAccountInserted = new List();
      for(Account_Request__c acc : trigger.new)
      {
      if(Account_Request__c.Account_Request_Status__c==’Convert’ && Account_Request__c.Is_this_an_Agency_or_Advertiser__c==’Advertiser’)
      {
      Account converted = newAccount (
      acc.RecordTypeId(‘012000000000jv1′) = Account_Request__c.Is_this_an_Agency_or_Advertiser__c,
      acc.Name =Account_Request__c.Account_Name__c,
      acc.Website =Account_Request__c.Website__c,
      acc.Contact_Email__c =Account_Request__c.Company_Email__c,
      acc.Phone =Account_Request__c.Phone__c,
      acc.BillingStreet =Account_Request__c.Billing_Street__c,
      acc.BillingCity =Account_Request__c.Billing_City__c,
      acc.BillingState =Account_Request__c.Billing_State__c,
      acc.BillingPostalCode =Account_Request__c.Billing_Zip__c,
      acc.BillingCountry =Account_Request__c.Billing_Country__c
      )
      ;
      }

      if(Account_Request__c.Account_Request_Status__c==’Convert’ && Account_Request__c.Is_this_an_Agency_or_Advertiser__c==’Agency’)
      {
      Account converted = new Account(
      acc.RecordTypeId=(‘012000000000jv2’) =Account_Request__c.Is_this_an_Agency_or_Advertiser__c,
      acc.Name =Account_Request__c.Account_Name__c,
      acc.Website =Account_Request__c.Website__c,
      acc.Contact_Email__c =Account_Request__c.Company_Email__c,
      acc.Phone =Account_Request__c.Phone__c,
      acc.BillingStreet =Account_Request__c.Billing_Street__c,
      acc.BillingCity =Account_Request__c.Billing_City__c,
      acc.BillingState =Account_Request__c.Billing_State__c,
      acc.BillingPostalCode =Account_Request__c.Billing_Zip__c,
      acc.BillingCountry =Account_Request__c.Billing_Country__c
      )
      ; }
      }
      }
      }

      Reply
        David Liu
        October 27, 2014 @ 8:13 pm

        What are you trying to do in line 11?
        acc.RecordTypeId(‘012000000000jv1′) = Account_Request__c.Is_this_an_Agency_or_Advertiser__c,

        Try posting it onto the forums to see if anyone can help! I suspect there are a couple minor things that need to be fixed here!
        https://www.sfdc99.com/forums/forum/beginning-apex/

        David

        Reply
          Donald "Delta" Bohrisch
          October 28, 2014 @ 9:33 am

          Trying to define between 2 Record Types that the info going to be inserted into. Trigger is taking a Record from our Custom Object ‘Account Request’ thats submitted by a user for our review and allowing us to UpDate the Record to ‘Convert’ in our ‘Account Request Status’ field. Once it is UpDated as ‘Convert’ then it becomes a record on our ‘Account’ Object, ie adding a new account. The ‘Is this an Agency or Advertiser’ is the field in our Custom Object that determines the Account Record Type the info will go to, ie ‘Advertiser’ or ‘Agency’. Tried to utilize the ID# because I couldn’t figure out how to simply call out the Account Record Type by name, ie ‘Agency Account’ and ‘Advertiser Account Record’.

          Thank you, Posted over there as requested

          Reply
Leslie Campbell
October 10, 2014 @ 4:06 pm

Hi, David.

I know you can customize a community to look totally different, but what about the internal pages of Salesforce? Can you change the color of the top border? Can you make all the blue a different color…like green? Thanks.

Reply
    David Liu
    October 11, 2014 @ 2:51 pm

    I’m sure you can, but it’s probably very hacky. I think it would also take a heck of a lot of work!

    Reply
Mehraj
October 9, 2014 @ 12:29 pm

Hi David….
My question is …. Is there any way i can give my administrator the permission of hard delete through his profile in a company and the company has only one salesforce license with it….

My another question is how can we write a trigger for creating an email to lead in my org as there is no direct way to create an email to lead in my org…

Reply
    David Liu
    October 9, 2014 @ 8:01 pm

    Gonna need more licenses Mehraj!

    You need to use email services to do the latter:
    https://developer.salesforce.com/page/An_Introduction_To_Email_Services_on_Force.com

    Reply
Samadhan Sakhale
September 25, 2014 @ 2:24 am

Hi David,
can you please tell me if i make custom object Address__c and it contains Account Id’s and by using that Id’s i have to copy related City__c from Address__c and by making new object in Account i have to copy that related cities in Account so please help me.
My written Logic is
List aa=[select Id from Address__c];
for(Integer i=0;i<aa.size();i++)
{
List adr=new List();
for(Account ac:Trigger.new);
{
if(aa[i]==ac.Id)
{
ac.City__c=adr.City__c;
insert ac;
}
}
}
if this is wrong please tell me another code.
Thank you,
Sam

Reply
Can
September 25, 2014 @ 1:50 am

Hi David,I face with some problems with developer console from your account .It has no activate new button and I can’t open new class,new tigger so on

Reply
Chuck
September 20, 2014 @ 8:46 am

David,
This being a great resource is an understatement. Question: I have many ‘small’ things I want to do that seem to be best solved using triggers. I can’t imagine our org’s needs are that original so I’m confident our particular need has already been solved and posted somewhere (or at least enough of the solution to so as to serve as a starting template). Do you know of a public useful trigger ‘repository’ or cheat sheet (like SFDC’s cheat sheet of useful formulas)? Thanks!

Reply
    David Liu
    September 25, 2014 @ 7:28 pm

    That’s actually a great idea Chuck, maybe we can make one!!!

    Reply
bhargav
September 16, 2014 @ 10:44 am

hi my self bhargav
can a describe code for this logic.(IN TRIGGERS concept)

Whenever the job record was created when update the joblocation field value with a value of account location field value

Reply
P.R.
September 8, 2014 @ 9:34 am

Hi David,

Can you please help me in this how to implement below scenario?

When a new case is created (manually or submitted via email-to-case) create a trigger to automatically assign an Account and Contact.

Reply
    P.R.
    September 8, 2014 @ 9:38 am

    Update

    When a new case is created (manually or submitted via email-to-case) create a trigger to automatically assign an Account and Contact based on data within the body of the case description, like a unique ID?

    Reply
      David Liu
      September 8, 2014 @ 8:47 pm

      In this case you’d use SOQL to find the right account and contact, then simply populate their lookup fields!

      Reply
Mike
August 29, 2014 @ 9:33 pm

I am writing a trigger, when the Is_Active__c = True for a Contact, then make All_Active_Contacts__c= true for the associated Account. Please help.

trigger CheckActive on Account (after update) {
List AllActiveContacts = new List();
List UpdatedAccount =new List();
Boolean onlyonce = false;
List AccountWithAssociatedContacts = [SELECT Id, Name,All_Active_Contacts__c,
(SELECT Id, LastName,Is_Active__c FROM CONTACTS WHERE Is_Active__c = True)
FROM ACCOUNT WHERE Id IN:Trigger.NewMap.KeySet()];
if(!AccountWithAssociatedContacts.IsEmpty()) {
if(!onlyonce) {
// for(Contacts con:AccountWithAssociatedContacts.CONTACTS){
// if(con.Is_Active__c ==true){
// AllActiveContacts.add(con);
// }
for(Account a:AccountWithAssociatedContacts){
a.All_Active_Contacts__c = true;
UpdatedAccount.add(a);
System.debug(‘@@The number of UpdatedAccount@@’+UpdatedAccount.size()+ a.id);
onlyonce = false;
}
}
// Update UpdatedAccount;
}

}

Reply
    David Liu
    September 1, 2014 @ 10:55 pm

    Needs even more System.debug =)

    Reply
Veera
August 24, 2014 @ 6:46 am

Hi David,

This is Veera ,Please share your mail id .I have couple of doubts on Visual force Pages,Please share your mail then i will send code snippets.`

Reply
    David Liu
    August 24, 2014 @ 2:56 pm

    For posting a lot of code, the developer forums are probably a better avenue! I can only provide high level guidance:
    https://developer.salesforce.com/forums/#!/feedtype=RECENT&criteria=OPENQUESTIONS

    Reply
sindoora
August 21, 2014 @ 2:27 am

Chapter 11…?

Reply
    David Liu
    August 21, 2014 @ 8:59 pm

    Still working on Chapter 8!!!!!!!!

    Reply
satish
August 15, 2014 @ 11:00 am

HI David Liu.

Can you please help me in this how to implement below scenario. As am new to this salesforce.

Notifications.

Trigger on ChatterFeed Item to count notification.
To increment Public Chatter Posts and Unread Public Chatter Posts when a public chatter post is created for a case.
Public Chatter Posts column with method action to update that case to have Unread Public Chatter Posts.

Reply
    David Liu
    August 15, 2014 @ 3:16 pm

    O_o probably can’t help you with this one, sorry!!

    Reply
      Anonymous
      August 15, 2014 @ 10:53 pm

      Can you guide how to do it.Any idea…

      Reply
sravan
August 14, 2014 @ 5:36 pm

Hi David,
I have overridden a button which is placed on a pagelayout. The issue is that i am redirecting to a visualforce page where we can take information and save it. But when the same is done on salesforce1 app it returns to the record but the editted values are not updated in the the detail page. unless the screen is pulled down and refreshed. Do we have a way to force refresh the detail page?
Thanks,
Sravan

Reply
    David Liu
    August 14, 2014 @ 9:39 pm

    Don’t have much experience coding in S1 unfortunately, so don’t have any good recommendations!!

    Reply
      sravan
      August 15, 2014 @ 10:44 am

      Thanks David

      Reply
chitral
August 7, 2014 @ 7:22 am

Login URL: https://login.salesforce.com
Username: learn@sfdc99.com
Password: iCanCode!

cant login
Your login attempt has failed. The username or password may be incorrect, or your location or login time may be restricted. Please contact the administrator at your company for help.

Reply
    chitral
    August 7, 2014 @ 7:41 am

    working !! :) i m starting it awesome …from nowhere to code i hv to become that awesome coder :))

    Reply
    chitral
    August 7, 2014 @ 7:47 am

    works now!!
    from nowhere to code ,now i hv started it with sdfc99.com ,have to b d coder now !!
    thnks david god bless u

    Reply
    David Liu
    August 7, 2014 @ 11:24 pm

    Works for me!

    Reply
      ranjan
      August 8, 2014 @ 10:04 pm

      Its working

      Reply
SD
July 23, 2014 @ 7:29 am

David, i am unable to login with your credentials. Could you pl check and share.

Reply
    David Liu
    July 27, 2014 @ 9:50 pm

    Works for me man!!

    Reply
      SD
      August 18, 2014 @ 3:11 pm

      Thanks David, I can login now

      Reply
Asha
July 22, 2014 @ 2:49 pm

Hi David
I’m trying to learn complete SFDC, both admin and dev. There is a training company that covers these below topics in their training sessions. Do you think these are enough for me to learn so that I can get certified? or do you suggest covering other topics? Is there any questions I should ask before committing to this training site? Thank you for your support. You are great.
1. Configuration
2. Data Utilities
3. Data Modeling
4. Administration
5. Customization
6. Business Logics
7. Reporting & Analytics
8. Visual force
9. APEX
10. AppExchange
11. Integration
12. Development on IDE

Reply
    David Liu
    July 27, 2014 @ 9:59 pm

    In my experience, certification classes are not sufficient to pass the exam unless you pair it with lots of hands-on experience.

    I know because I’ve put many of my coworkers through the official classes and the results are no good!

    Reply
Boopas
July 16, 2014 @ 9:35 am

I’m a .Net developer..and wish to become a SF developer. Suggest me the best starting point – please.

Reply
    David Liu
    July 16, 2014 @ 9:37 pm

    Right here!
    https://www.sfdc99.com/beginner-tutorials/

    Reply
Avinash
July 15, 2014 @ 4:05 am

Hi David

I am 401 certified developer. I want to learn 301 and 501 as well. I would want to be a Business Analyst or a Consultant. Could you please help me out on this. I know you are the right person to have a chat regarding SFDC. Thanks.

Reply
    David Liu
    July 15, 2014 @ 10:07 pm

    For a BA, the most valuable certs are 301, CON201, and the service cloud cert!

    Reply
anjani
July 9, 2014 @ 6:37 pm

Hi David Liu,

I’m new to this Sales force

I don’t have any clue where to start and little bit Confused about ‘

Salesforce CRM And Salesforce developer /admin

Is there any difference between them or They both are Same

Reply
    David Liu
    July 9, 2014 @ 7:48 pm

    Admin configures Salesforce without code!

    Developer configures Saleforce with and without code!

    I recommend learning the admin side before starting the dev side:
    https://www.sfdc99.com/beginner-tutorials/

    Reply
Parthi
July 2, 2014 @ 5:37 am

Hi David,
I have planned to write my dev 501 this month can you suggest me few ideas regarding the exam. So that it would be more helpful for me!!!

Reply
    David Liu
    July 2, 2014 @ 8:11 pm

    Quizlet.com is all you need =)

    Reply
Karthick
June 28, 2014 @ 5:46 am

login is not working now

Reply
    David Liu
    June 28, 2014 @ 11:24 am

    It works for me!! Don’t forget the exclamation mark!

    Reply
perveen
June 20, 2014 @ 12:32 pm

Your credencials are not working could you please check

Reply
    David Liu
    June 21, 2014 @ 10:51 pm

    Fixed!

    Reply
Anonymous
June 19, 2014 @ 1:57 pm

Unable to login to learn@sfdc99.com plz help

Reply
    David Liu
    June 21, 2014 @ 10:51 pm

    Good to go!

    Reply
Lawrence
June 19, 2014 @ 7:27 am

Hi David ,

Thanks for the response.
I am very new to Apex and am still trying to get my feet around it.

After doing a lot of Googling and even going on the stack exchange I understood what the concept is to write the trigger but I am a bit worried if I get it wrong and what exactly do I need to do.

As mentioned yesterday I am trying to link an asset to a contact. They are both related but at the moment in my org the asset is created from the account and not from the contact . I want to create that relation between contact and asset too.

This is the concept I understand below but would be helpful if you could help with the code for this first time.

Understanding of the trigger that I have:

I need to create the trigger on asset.
Need to get the unique id which matches both asset and contact.So in this case is Acount id.as it is the common denominator between the asset and contact.
I would then need to map the account id of contact to account id of asset
When they match I need to populate the contact id for that account on asset

Reply
Lawrence
June 18, 2014 @ 7:23 am

Hi,

David I am new to SFDC99 and first of all want to thanks you for all the hard work.

I am trying to create a trigger and need a bit of help

I have a situation where I have an account which is related to contact and to the asset. My data is coming into salesforce through integration.
Now the other scenario though my contact and asset are related when the data is populated onto the asset the contact lookup is not populated. So in another way they are not related though there is a lookup field on asset for contact.

The scenario would be simple if contact was linked to asset but it is not.
My company needs a report with all accounts along with asset details and details from contact for the asset.

I have 2 solutions:
1 Pre-populate fields on asset from contact. I tried doing URL hack which was not succesful as the data is coming into SFDC through integration so the button that I create would be no good.
So my question is please help me write a trigger to pre-populate fields from contact onto asset(name,email and phone no)

2 or pre-populate the lookup contact field on asset so the relationship is created.

I hope I have been able to explain properly.

Please can you help with this

Reply
    David Liu
    June 18, 2014 @ 9:39 pm

    Always do #2 in these sort of situations =)

    The reason is you’ll always get new requirements, so you have to go with the solution with the most long-term value. Doing #2 opens up workflows and formula fields for future reqs!

    David

    Reply
Liquid
June 10, 2014 @ 2:22 pm

Wow, by far the best site I have found concerning SaleForce!! Have been looking through your videos and tutorials the last couple of hours and am very grateful!! Thank you so much!!

Reply
    David Liu
    June 10, 2014 @ 6:35 pm

    My pleasure!

    Reply
suresh
June 7, 2014 @ 4:00 am

SO its not working your credencials

Reply
    David Liu
    June 8, 2014 @ 8:20 pm

    All fixed – sorry! Password expired hahaha

    Reply
    Anonymous
    June 13, 2014 @ 9:45 am

    Hi david please can you gude for coding side I all ready seen you tube alsi its doing very great david please can you guide me ………………

    Reply
      David Liu
      June 17, 2014 @ 6:20 pm

      Do all the tutorials here in order, and make sure to do the quizzes!!!
      https://www.sfdc99.com/beginner-tutorials/

      Reply
Linda
June 6, 2014 @ 10:40 am

Will the recordings for Build on the Basics and Beyond the Basics be available soon. I missed those webinars.

Thanks for your great work David. I think I can do this

Reply
    David Liu
    June 8, 2014 @ 8:22 pm

    Yup – will have them up as soon as they’re done being edited!! Probably another week!

    Reply
Nitin
June 6, 2014 @ 3:50 am

Thanks David for sharing your credentials. I was able to login to this account earlier but now I am getting below mentioned error. Can you please check

“Your login attempt has failed. The username or password may be incorrect, or your location or login time may be restricted. Please contact the administrator at your company for help.”

Reply
    David Liu
    June 8, 2014 @ 8:22 pm

    Sorry about that Nitin – all good now!

    Reply
      Nitin
      June 11, 2014 @ 11:47 pm

      Thanks David…. you are the MAN!!! :D

      Reply
Saraz
June 5, 2014 @ 2:36 am

David, you are Great!!

Reply
Erica Thomas
June 4, 2014 @ 8:10 am

Hi David,

I have been following your tutorials and bought the Head First Java book as well. Thank you for creating such a great resource that’s so easy to understand. Can you take a look at the code I’m wrestling with?

I am trying to create an Export to Excel button that would appear on our Account related list “Agency Planning”. I am receiving the syntax error: “Error: Export_to_Excel line 4, column 71: Element type “apex:pageblocktable” must be followed by either attribute specifications, “>” or “/>”

I ended line 4 with “>” but the error is still appearing. Any help would be great!

Thanks!
Erica Thomas

Reply
    David Liu
    June 4, 2014 @ 8:54 am

    Can’t see the code you’re referring to but this is probably the error!

    <apex:pageBlockTable>
      <!– Stuff goes inside here –>
    </apex:pageBlockTable>

    Can’t forget the / in the second (closing) pageBlockTable tag!

    Reply
      Erica Thomas
      June 4, 2014 @ 9:06 am

      Hi David,

      Sorry about that! My code is below. I have the / in the closing pageBlockTable tag, but am still receiving the error.

      </apex:page

      Reply
        Erica Thomas
        June 4, 2014 @ 9:07 am

        </apex:page

        Reply
          David Liu
          June 8, 2014 @ 8:31 pm

          You’ve probably noticed that code doesn’t work well in comments here XD

          Try taking out all of these and it’ll work!
          < or >

          Reply
      Karthick
      June 28, 2014 @ 5:45 am

      Hi david,
      There is a problem in login to salesforce

      Reply
rohan stanny lopes
June 2, 2014 @ 2:55 pm

david thanks for the login and password for developer edition !!!

Reply
Rakesh
June 2, 2014 @ 7:54 am

Thanks David for putting together such an awesome apex learning resource center for beginners like me.

Reply
    David Liu
    June 2, 2014 @ 7:59 pm

    My pleasure!

    Reply
Anonymous
June 2, 2014 @ 7:51 am

Hi David, sfdc99 is awesome!!! my quest for learning apex as an admin has now got a new boost.

Reply
Rabia
May 23, 2014 @ 7:38 am

Hi david, I am learning to write a trigger, The requirement is when I add voter id(Enter_your_Voting_ID__c) and if it exists in our record then only one can vote…otherwise it will give an error “Voter ID does not exist”. It is not working, Could you please help me in correcting it…

trigger voterexists on Voting__c (before insert) {
public set voteridSet = new set();
public list voterlist = new list();
try{
for(Voting__c vote:trigger.new){
voteridSet.add(vote.Enter_your_Voting_ID__c);
system.debug(‘======vote.Enter_your_Voting_ID__c=========’+vote.Enter_your_Voting_ID__c);
}
voterlist =[select Enter_your_Voting_ID__c from Voting__c where Name in :voteridSet];
system.debug(‘======voterlist =========’+voterlist );
if(voterlist.isEmpty()==Null)
trigger.new[0].name.addError(‘Voter ID does not exist’);
}
catch (exception e){
system.debug(e.getmessage());
}
}

Reply
    David Liu
    May 24, 2014 @ 12:32 am

    Try an after insert trigger =)

    https://www.sfdc99.com/2014/01/25/use-vs-triggers/

    Reply
Fareen
May 22, 2014 @ 9:10 pm

I am unable to login to the sfdc99 org ,please help me.

Reply
    David Liu
    May 22, 2014 @ 10:13 pm

    The login works for me!
    https://www.sfdc99.com/login-to-sfdc99/

    Reply
Rahul Raturi
May 16, 2014 @ 2:08 am

Hi David,

I am able to log in the org mentioned by you but when i am going to see test page(VS page),it shows me a message on page that ” You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.
“

Reply
    David Liu
    May 17, 2014 @ 10:47 am

    Try creating a record from scratch =)

    Reply
Sumit Rana
May 13, 2014 @ 10:40 am

Hi David,

You are awesome man.. You have made coding a fun.. (can’t imagine the hard work you have put behind it).. I am new to the coding world in salesforce but your tutorials has helped me a lot so far.. many thanks ..cheers man !!!!!

Reply
Derek
April 25, 2014 @ 1:40 pm

Hello David,
Your site has been extremely beneficial in my short time working with Apex (~2 days!).
I have watched your videos and was able to get my Trigger working exactly as I wanted it to within the sandbox.
I setup the class very similar to yours in the video, and was able to get it to pass as well.
However, I cannot get past the code coverage of 75% (stuck at 33%, 2/6) and I’m really unsure how to troubleshoot my code.

What I’m attempting to do:
I have created two custom activity fields that will be shown on the task layout (Mobile__c, Title__c).
These two fields pull from the contact’s standard fields (MobilePhone, Title).

Here is my trigger:

Trigger Task_Mobile on Task(before insert, before update){

Map<Id, List> whoIdsMap = new Map<Id, List>();

for(Contact con : [Select Id, Name, MobilePhone, Title from Contact where Id in :whoIdsMap.keySet()]){

for(Task t :whoIdsMap.get(con.Id)){
t.mobile__c = con.MobilePhone;
}
for(Task t : whoIdsMap.get(con.ID)){
t.title__c = con.Title;
}
}
}

Here is my class:

@IsTest
public class TestTask_Mobile {

static testmethod void insertTask() {

Task u = new Task();
insert u;

u.ownerID=’005C0000004wuPO’;
u.Subject=’Run Test Trigger’;
u.Status=’Not Started’;
u.Priority=’Normal’;

}
}

I would greatly appreciate your thoughts/advice on next steps!

Thanks David,
Derek

Reply
    Derek
    April 25, 2014 @ 1:57 pm

    Sorry David, I posted the wrong trigger. Below is the one that works:

    Trigger Task_Mobile on Task(before insert, before update){

    Map<Id, List> whoIdsMap = new Map<Id, List>();

    for(Task t : trigger.new){

    if(t.WhoId != null){

    if(!whoIdsMap.containsKey(t.WhoId)){

    List temp = new List();

    temp.add(t);

    whoIdsMap.put(t.WhoId, temp);
    }else{

    whoIdsMap.get(t.WhoId).add(t);
    }
    }
    }

    for(Contact con : [Select Id, Name,MobilePhone from Contact where Id in :whoIdsMap.keySet()]){

    for(Task t :whoIdsMap.get(con.Id)){
    t.mobile__c = con.MobilePhone;
    }
    }
    for(Contact con : [Select Id, Name,Title from Contact where Id in :whoIdsMap.keySet()]){

    for(Task t :whoIdsMap.get(con.Id)){
    t.title__c = con.Title;
    }
    }
    }

    Reply
      David Liu
      April 25, 2014 @ 9:38 pm

      Awesome trigger so far!!!

      If you click the test coverage %, Salesforce will tell you which lines of code are not covered in your test! Most likely your trigger doesn’t need to run certain lines of it because your test data doesn’t satisfy the right criteria according to your trigger.

      Also – you can combine the last two SOQL queries!

      Very impressed with two days of work, sheesh slow down!!
      David

      Reply
Raghvendra Rathore
March 31, 2014 @ 4:40 am

Very usefull content for the beginners :)

Reply
Kunal
March 30, 2014 @ 5:33 pm

Hi David,

I have below question relating to trigger.

how to update a field based on another field in salesforce?

For example,

There’s Opportunity TAB > then under the Opportunity TAB there’s a FIELD name Update Status.

Now, I want to UPDATE a field(opportunity) based on another field(Status Update) in Salesforce.

Please, Help me.

Thank you,

Reply
    David Liu
    March 31, 2014 @ 6:04 pm

    Hey Kunal,

    Keep reading through the chapters and it should become clear how to do this! You’ll want to finish Chapter 4 at least =)

    Basically you need to have a trigger on your base objects, then use SOQL to get your related objects. Then simply do something like this:
    relatedObject.fieldX = baseObject.fieldY;
    update relatedObject;

    Hope this helps!
    David

    Reply
Athena
March 11, 2014 @ 5:16 am

thanks for helping and guiding beginners in sfdc.. :)

Reply
    David Liu
    March 11, 2014 @ 7:29 pm

    Np <3 u guys and gals!

    Reply
Khilesh B Patle
March 10, 2014 @ 1:25 am

Hi David,
Need to direct log in from Facebook to Salesforce Community(Partner Portal user).
How i can achieve this please share knowledge & supporting docs,

Thanks,
Khilesh

Reply
    David Liu
    March 10, 2014 @ 7:13 pm

    Check this out!
    http://blogs.developerforce.com/developer-relations/2012/01/social-single-sign-on-authentication-providers-in-spring-12.html

    Never personally done anything like this so sorry that I don’t have better info!
    David

    Reply
jodev
February 28, 2014 @ 4:42 am

how to write test class for URL comparison….

Reply
    David Liu
    March 2, 2014 @ 4:02 pm

    Happy to help – is there any more detail you can provide with the requirements?

    Reply
Santhosh
February 12, 2014 @ 8:24 am

Hi David

Have been following the site, Great effort and very lucidly explained. Great to see that you are responding to posts. Looking forward to your posts on classes.

We have a requirement to do a deep clone. In the below post the bottom most code meets our requirement but there seems to be a few syntax errors. Could you explain this a little?

Public shared class AccountDeepCloneUtil
{
public static void cloneAccount(Account acc)
{
Map<Opportunity,List> OpportunityLineItemsMapping = new Map<Opportunity,List>();
List newOpportunityList = new List();
List oppList = [Select Id, Name,(Select Id,from OpportunityLineItems) from Opportunity where AccountId = :acc.Id];
Account newAcc = acc.clone(false, true); //do a deep clone
//insert the account record
insert newAcc;
for(Opportunity opp : oppList){
Opportunity newOpp = opp.clone(false, true); //do a deep clone
newOpp.Account = newAcc.Id;
newOpportunityList.add(newOpp);
OpportunityLineItemsMapping.put(newOpp,opp.OpportunityLineItems.deepClone(false,false,false));
}
//insert opportunity
insert newOpportunityList;

for(Opportunity opp :OpportunityLineItemsMapping.keySet()){
for(OpportunityLineItemoppLineItem : OpportunityLineItemsMapping.get(opp)){
OpportunityLineItem.OpportunityId = opp.Id;
}
}

insert OpportunityLineItemsMapping.values();
}
}

Reply
    David Liu
    February 12, 2014 @ 7:12 pm

    Thanks Santhosh!

    What’s the error msg you’re receiving and which line?

    Reply
sanjay15689
February 9, 2014 @ 10:34 am

Excellent work David.. I want to know more about batch apex .Is their any video for that
Appreciate your help

Thanks,
Sanjay

Reply
    David Liu
    February 10, 2014 @ 7:09 pm

    Thank you Sanjay!

    I haven’t covered Batch Apex yet but you can check it out here!
    http://developer.force.com/cookbook/recipe/using-batch-apex-to-reassign-account-owners

    David

    Reply
Sanjay Gupta
January 21, 2014 @ 7:54 am

Hi david,i have one query from admin part.
1) I have 2 users of same profile (e.g Standard user cloned as custom profile).
2) There is one custom object (Student).
3) The OWD settings are public read only for this custom object.
I want one of my user can read and edit the custom object records and the other user of same profile can only read and not edit.How can i achieve this?

Reply
    David Liu
    January 21, 2014 @ 8:58 pm

    Permission sets, baby =)
    https://help.salesforce.com/HTViewHelpDoc?id=perm_sets_overview.htm&language=en_US

    These let you assign permissions (like edit rights) to specific users instead of profiles!

    Reply
kumar
January 19, 2014 @ 11:28 am

Hi David,

when I write a trigger on force forcasting…getting error while creating user.

.Allow Forecasting is not allowed for this License Type.

How to get resolved this to run my first trigger

Reply
    David Liu
    January 19, 2014 @ 11:39 am

    Hey Kumar,

    Forecasting is only allowed for users with a normal Salesforce license! It’s possible that your org is out of these licenses so Salesforce is defaulting to a “free” license, like Chatter Free. So make sure you have licenses!

    David

    Reply
Nitesh Jain
January 17, 2014 @ 5:23 am

Wonderful stuff !!

I’m new to SFDC development and would like to know that how do i start from scratch ?
I know the SFDC platform but this is first time I’m coding.

Many Thanks
Nitesh Jain

Reply
    David Liu
    January 17, 2014 @ 8:18 pm

    Welcome to the world of Apex Nitesh!

    This is the best way to get started:
    https://www.sfdc99.com/2013/05/20/the-best-way-to-quickly-learn-how-to-code-in-salesforce/

    And of course, check out the tutorials in order!
    https://www.sfdc99.com/beginner-tutorials/

    Reply
Sanjay Gupta
January 14, 2014 @ 7:53 pm

hi david,the links you send me helped me a lot to understand ADM part of salesforce.i learnt about many things.now,i want to move further to dev part.can you send me startup material for Visual force pages and apex codes.

Reply
    David Liu
    January 14, 2014 @ 8:00 pm

    Awesome!

    Visualforce will come soon but in my opinion it’s not worth doing until you have a good grasp of Apex in general.

    I will get there I promise!

    Reply
prasanth
January 14, 2014 @ 7:21 pm

Hi, thank you for sharing nice article . I am a beginner for salesforce.com i searched many website but your the best . Every day i use to read your articles.hsalesforce login

Reply
    David Liu
    January 14, 2014 @ 7:59 pm

    Yes!!! Thank you – the best is yet to come!

    Reply
Sunil
January 4, 2014 @ 2:13 am

David, It’s generous of you sharing your credential.

Reply
    David Liu
    January 4, 2014 @ 5:17 pm

    It’s a free developer org thank goodness =)

    Reply
      Suvajit
      April 12, 2015 @ 11:04 am

      Hi David

      The credentials did not work for me. Can you please reset them and provide us the same?

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


*

*

Theme: Simple Style by Fimply