How to write test class for wrapper class in salesforce

Following code will be helpfull to cover wrapper class: Account acc=new Account (); acc.Name=’test‘; insert acc; Checkbox_Class.accountwrapper wrap=new Checkbox_Class.​accountwrapper (acc); I hope you find the above solution helpful. Full Answer How to set a wrapper class before calling the class? You have already called a class which invokes the wrapper class. This will automatically call … Read more

How to write test class for schedulable class in salesforce

Lets say for example your schedular class is global with sharing class Batchaccountcountfieldschedule implements Schedulable { global void execute (SchedulableContext sc) { Batchaccountcountfield bb = new Batchaccountcountfield (); database.executebatch (bb); } } Then your test class would be, Full Answer How do you write a test class for Schedulable batch class in Salesforce? Write a … Read more

How to write soql queries in salesforce

Write SOQL Queries Learning Objectives. Write SOQL queries in Apex. Execute SOQL queries by using the Query Editor in the Developer Console. Get Started with SOQL. To read a record from Salesforce, you must write a query. Salesforce provides the Salesforce… Basic SOQL Syntax. The WHERE clause is optional. Let’s start with a very simple … Read more

How to write code in salesforce

After logging in to your org, click Developer Console under the quick access menu () or your name. When you open the Developer Console for the first time, you see something like this. The main pane (1) is the source code editor, where you can write, view, and modify your code. Code Editor in the … Read more

How to write apex trigger in salesforce

Steps to Create an Apex Trigger Open Developer Console. Navigate to Salesforce Developer console from Salesforce Login. New Apex Trigger. Click on File menu item. … Trigger Name and sObject Selection. Once you click on Apex Trigger, a small pop-up window appears. … New Apex Trigger Created. A new Apex Trigger is created with the … Read more

How to write apex code in salesforce

Click New, and then enter your code in the Body text box. You can’t modify Apex using the Salesforce user interface in a Salesforce production org. Alternatively, you can use any text editor, such as Notepad, to write Apex code. Then either copy and paste the code into your application, or use one of the … Read more