Apex Syntax: How to better understand the Apex Syntax and Logic in Salesforce?
A free video tutorial from Deepika Khanna
4.4 instructor rating • 32 courses • 102,147 students
Learn more from the full courseSalesforce Development Training for Beginners
Salesforce Development :Learn about Apex programming and Salesforce development. Become a Salesforce Developer.
13:50:14 of on-demand video • Updated April 2021
- you will have a mastery of programming in Apex no matter what level of experience you are at right now.
- My goal is not just to show you how to program, but to help you understand what you are doing, and why you are doing it as well!
- Not only do the videos show you how to become a Apex programmer in great detail, but this course also contains lot of assignments to practice.
- I'll be constantly adding new material to the course as well as updating it on a regular basis to make sure you access to the best and most update to date and comprehensive Apex training
English [Auto] Hello, guys, welcome back. In this tutorial, we are going to take a look at IPEX Syntex. So what are the different things that are available in iPIX program? So Epic's program has things like variable declaration. You would write Esequiel queries, Leupp statements from flow control statements, the statements, and what are each of them? We're going to take a look deep dive into those, but let's see what variable declaration looks like. So you can see here, the second line that you see, it's a variable declaration. Now, what do you mean by a variable label is used to store some data. That is what the variable is used for. So here what we are creating is we are creating a variable to store the list of accounts. If you have more than one account records that you want to store, then in order to store that list, you're going to need a placeholder. So that is what we are done here is we are declaring a variable which will be used to store a bunch of account records. Then the second the next statement looks like select the common name description from account. So this is called as an Esequiel query. Now, the Esequiel query is used to retrieve data from Salesforce. OK, so if you wanted to pull out information related to an account of your specific, if you're interested in a particular account, you can use this as a query in order to retrieve the data, then the next thing is a loop statement. So let's say there are three records that are available or three account records. And in each of those account records, you wanted to update a particular field of all of those records. So what you will do is you will you will go over these records one by one and update that field of every record so those things can be done using the loop statement. So here what you're doing is we are using a for loop and we're iterating over means we are going over the list account, which is nothing but the variable which has the list of account records. So we are going over those records one by one. And then what we are doing is we are updating the description field on those records to something like this and then we are adding back to another list. So this is what the loop statements looks like. So if you wanted to iterate over records one by one or if you want to update something in, let's say, ten records or 10 account records of what you're going to do, you're going to go ahead and update using the for loop. You will iterate over those records and update the feed. Then you have a flow control statement. Now, what do you mean by flow control means if there is a if you want to achieve something based on a particular condition. So that is called flow control. So if you're checking if the account update does not equal to null or the size of the list is greater than zero, then do this. So this is what if else, conditionals flow control means if you want to do something based on a particular condition and if that condition is met, do this if that condition did not do something else. So those are called as flow control statements. We'll talk about those in the scores as well. Then we have as DMS statements. As I told you, those are called data manipulation language, which means if you want to manipulate the data, if you want to update something, if you want to insert it according to Salesforce, then you're going to use these statements. So the statement looks like this. So you're making an update. Do sales force this account of what you're doing here as you are doing an update to this particular record? So whatever you have, whatever whatever the records you have inside of this variable, all of those will get updated using this update statement. So this is how the dismal statement looks like. So these are the different features or these are the different things that you're going to use inside of your apex. And these are the things that makes the apex program. So we'll have variable declarations. You will need some way to retrieve the data, do it right over the data to use if conditions to write the email statements, etc.. So this is what an epic program will look like. Now, in the next tutorial, we are going to start with the very basic, which is called What is a variable and how do we declare a variable iPIX. So I'll see you then. Thank you so much.