function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krishna.nanikrishna.nani 

how to test a simple programme

Hi,

 

  I am new to salesforce, can any body help me  out,this is the sample program,please help me out how to

execute below programme.

 

 

public class newaccount
{
Integer num=10;
public void testmethod testcontroller()
{
NewAccount_c[] accs;
accs = [SELECT Id FROM NewAccount__c WHERE name LIKE 'v%'];
Delete accs;
}
}
private class testclass
{
newaccount accs= new newaccount();
accs.testcontroller();
}

pumbaapumbaa

If you just want to run this class you can click on yourname on top right corner and choose Developer Console and run it there.

Copy these two lines from your private test class:

 

newaccount accs= new newaccount();
accs.testcontroller();

 

Click Debug tab -> Open Execute Anomynous window and paste your code there. Then click Execute button.

 

Hope this answer your question.

 

Ricky