You need to sign in to do that
Don't have an account?

trailhead challenge 'manipulate records with dml'
Hi guys,
Im trying to get into apex programming by doing the trailhead challenges.
Sadly, I'm stuck at the challenge 'manipulate records with dml'.
To my programming knowledge: I only know very few java basics from school, so I'm definetly new to it.
Here is how my code looks at the moment:
I would like to know if my code above is correct and how to implement the empty DML string that should return NULL.
Any help is appreciated.
Im trying to get into apex programming by doing the trailhead challenges.
Sadly, I'm stuck at the challenge 'manipulate records with dml'.
To my programming knowledge: I only know very few java basics from school, so I'm definetly new to it.
Here is how my code looks at the moment:
public class AccountHandler { public static String insertNewAccount(String name) { Account acct = new Account(); acct.Name = name; return Name; } }
I would like to know if my code above is correct and how to implement the empty DML string that should return NULL.
Any help is appreciated.
Greetings to you!
You need to use try-catch. You can use below code:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks and Regards,
Khan Anas
All Answers
Greetings to you!
You need to use try-catch. You can use below code:
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks and Regards,
Khan Anas
thank you very much for your answer. It worked perfectly.