You need to sign in to do that
Don't have an account?
Apex Code Examples/Samples, Practice and Use cases
Hi,
I have read the Apex concepts but I am not getting enough confidence in Apex coding, probably I need to practice more.
I was looking for Apex code examples/samples and use cases in google, but couldnt get any.
Can you please let me know if you have links to the Apex code examples/samples and use cases for Apex to try practicing.
Also for Apex classes and triggers, please let me know the following:
1. On which parts of Apex, I need to start for code practice and how to proceed further.
2. While practicing, what should be the areas that I need to practice more
3. What areas of Apex are commonly used
4. What areas of Apex are complex which needs more practice
5. How to frame the use cases myself for Apex code practice.
Thanks,
Priya.
Hi,
You can go through cook having good code samples and you can participate in discussion boards to share and update your knowledge.
http://developer.force.com/cookbook/
For the questions you have
1) You go through Apex book like
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
2) We can’t say commonly used area like that, but conditional statements (if, for..), Collections(set, list,map), Property variables(getter settes), test methods, etc will be used commonly to write any code.
I am dealing with same situation. Any other helpful stuff apart from cookbook ??
I have gone through apex work book and i want to explaore further can any body please suggest some scenarios and code examples.
http://www.sfdc99.com/beginner-tutorials/
Amount_X
Amount_Y
2) Make one picklist field "Type" , values ('Positive', 'Negative')
3) Make two number fields on account
Rollup_Amount_X
Rollup_Amount_Y
Rollup_Amount
4) Make one trigger on contact object, which will do following:
--> Sum all child of contact's field "Amount_X" and store in parent account's "Rollup_Amount_X" Where Type is "Positive"
--> Sum all child of contact's field "Amount_Y" and store in parent account's "Rollup_Amount_Y" Where Type is "Negative"
--> Sum all child of contact's field "Amount_X" + "Amount_Y" and store in parent account's "Rollup_Amount"
5) Make trigger as bulk / Test class
Before starting the Apex ,You should have basic knowldge of OOPS concepts in java .
1. On which parts of Apex, I need to start for code practice and how to proceed further.
Ans :Start writing simple codes like Basic insertion of sobject records.
2. While practicing, what should be the areas that I need to practice more.
Ans :Once you get high level concept of Apex ,You can start writing visualforce page with custom controllers .
3. What areas of Apex are commonly used
Ans :It would completely depend on requirement .
5. How to frame the use cases myself for Apex code practice.
Please find the below post which can provide you basic Apex classes with the description .
Apex Code Examples (https://salessforcehacks.blogspot.com/2020/01/sales-force-basic-apex-class-examples.html)
You can find the below post for more apex trigger examples .
Apex Trigger Examples (https://salessforcehacks.blogspot.com/2020/02/apex-trigger-examples-salesforce-apex.html)