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!
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?
hii david
Looks like the credentials aren’t working now.
Updated!
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.
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
Sorry – has been resolved
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!
Hey Femi you’ll want to create your own org here! https://developer.salesforce.com/signup
David I am not able to login to salesforce using the credentials given.
Updated =)
Hi David,
I am having trouble logging into your org. Can you please share the credentials via srinath4sfdc@gmail.com
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
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.
need updated credentials
Done!
Mr David,
send your updated credencial to log into your org.
It will be more helpful to me if you give me
Updated! Thank you Hari!
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.
David, You should may be create an installable package? Do you need help, I can do that for you.
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.
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.
Check this out!
bit.ly/go-apex
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.
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
Dev console.
Is this still updated for current salesforce devs 2018?
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);
}
}
LOL that’s awesome man =)
What to do about the security token??
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 =) ]
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.
Hi, David.
The credentials aren’t updated.
Thank you :)
Updated!
David
Plz share your updated credentials.I am not able to login to your org.
Done!
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
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
Updated!
Thank you Sir David :*
Please share the working credentials..
thanx..
Done!
Thank You David..
But you need to update it again!.
It’s not working.
It’s working now =)
Hi David,
The credentials do not work still. Could you please reset them?
Done!
Hi David
The credentials do not work. Could you please reset them?
Done!
The credentials do not work still. Could you please reset them?
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 ?
Possible, but you’d need a custom Visualforce/Lightning page
using trigger it can be done
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.
LOL I sure do!
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.
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
Hi David,
Is salesforce developer edition is free or does it involve any costs?
100% free =) I have like 100 of them!
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 :)
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.
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)
Thank you David…
Credentials not work for me. could you pls check once
Thanks for the heads up – updated!
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?
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
Use a formula field!
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
Is this site insufficient so far? =)
Hi David- Could you please let us know some idea to write test classes for inbound and outbound webservices.
Check out this doc!
https://developer.salesforce.com/docs/atlas.en-us.198.0.apexcode.meta/apexcode/apex_classes_restful_http_testing.htm
Hi David ,
I am using your org to learn. Thanks for credentials.
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.
Everything on this site!
credentials did not work for me…!
Looks like the credentials aren’t working now
Updated!
P.S. random person who changed the email address/password: when you change the email address I know who you are!!!
LOL!! I love it.
Hi David, The user name and Id provided is not working for me.
Fixed!
above credentials are not working anymore. Could you please provide correct details.
Thanks,
Kaushik
Fixed!
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?
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!
Hi David, The user name and Id provided is not working for me.
It’s working for me – you might want to try again!
You are right – I did not need to include the security token on the end of the password, this was my error. Thanks David!
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.
I hide those options so the org doesn’t get tampered with too much =)
Workbench should work though!
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
Nice Story David, learnt something today ! Explains why you reply to most of these. Keep up the Spirit !
Hi David,
Anitha from India!!!
Very impressive.. your efforts to help us….Thanks..
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.
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.
We are those Fish David and you are making a big difference in our knowledge.
Cute!
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
This login is read only in my org =)
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.
Too much code to debug right now, sorry!! Try our forums or the official ones =)
Hi David, The user name and Id provided is not working for me.
Updated! Thanks for the heads up!
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
Oh boy too many questions for me, drank too much Guinness to even attempt this!
I know its too many! But Can you give me the Alphabetic answers Ex: 1AB ,2B…… \
Thanks David
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 !!!
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.
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!
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.
Check this out!
https://www.sfdc99.com/2014/10/02/guide-to-passing-all-salesforce-certifications/
HI David,
user name and id that u have provided to us is not working.
Thanks for the heads up – updated!
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
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 =)
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
I rarely see those roles so they could be open ended. Worth trying just to learn!
HI David,
user name and id that u have provided to us is not working
Thanks for letting me know – updated!
https://www.sfdc99.com/login-to-sfdc99/
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.
Start here =)
https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST
Just started to learn coding in salesforce and saw ur site and youtube. Excellent job, i will follow thru your tutorials. =P
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
}
}
}
}
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
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
)
; }
}
}
}
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
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
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.
I’m sure you can, but it’s probably very hacky. I think it would also take a heck of a lot of work!
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…
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
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
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
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!
That’s actually a great idea Chuck, maybe we can make one!!!
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
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.
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?
In this case you’d use SOQL to find the right account and contact, then simply populate their lookup fields!
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;
}
}
Needs even more System.debug =)
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.`
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
Chapter 11…?
Still working on Chapter 8!!!!!!!!
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.
O_o probably can’t help you with this one, sorry!!
Can you guide how to do it.Any idea…
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
Don’t have much experience coding in S1 unfortunately, so don’t have any good recommendations!!
Thanks David
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.
working !! :) i m starting it awesome …from nowhere to code i hv to become that awesome coder :))
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
Works for me!
Its working
David, i am unable to login with your credentials. Could you pl check and share.
Works for me man!!
Thanks David, I can login now
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
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!
I’m a .Net developer..and wish to become a SF developer. Suggest me the best starting point – please.
Right here!
https://www.sfdc99.com/beginner-tutorials/
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.
For a BA, the most valuable certs are 301, CON201, and the service cloud cert!
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
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/
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!!!
Quizlet.com is all you need =)
login is not working now
It works for me!! Don’t forget the exclamation mark!
Your credencials are not working could you please check
Fixed!
Unable to login to learn@sfdc99.com plz help
Good to go!
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
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
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
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!!
My pleasure!
SO its not working your credencials
All fixed – sorry! Password expired hahaha
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 ………………
Do all the tutorials here in order, and make sure to do the quizzes!!!
https://www.sfdc99.com/beginner-tutorials/
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
Yup – will have them up as soon as they’re done being edited!! Probably another week!
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.”
Sorry about that Nitin – all good now!
Thanks David…. you are the MAN!!! :D
David, you are Great!!
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
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!
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
</apex:page
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 >
Hi david,
There is a problem in login to salesforce
david thanks for the login and password for developer edition !!!
Thanks David for putting together such an awesome apex learning resource center for beginners like me.
My pleasure!
Hi David, sfdc99 is awesome!!! my quest for learning apex as an admin has now got a new boost.
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());
}
}
Try an after insert trigger =)
https://www.sfdc99.com/2014/01/25/use-vs-triggers/
I am unable to login to the sfdc99 org ,please help me.
The login works for me!
https://www.sfdc99.com/login-to-sfdc99/
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.
“
Try creating a record from scratch =)
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 !!!!!
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
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;
}
}
}
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
Very usefull content for the beginners :)
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,
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
thanks for helping and guiding beginners in sfdc.. :)
Np <3 u guys and gals!
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
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
how to write test class for URL comparison….
Happy to help – is there any more detail you can provide with the requirements?
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();
}
}
Thanks Santhosh!
What’s the error msg you’re receiving and which line?
Excellent work David.. I want to know more about batch apex .Is their any video for that
Appreciate your help
Thanks,
Sanjay
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
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?
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!
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
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
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
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/
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.
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!
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
Yes!!! Thank you – the best is yet to come!
David, It’s generous of you sharing your credential.
It’s a free developer org thank goodness =)
Hi David
The credentials did not work for me. Can you please reset them and provide us the same?