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
chinni dchinni d 

diff b/n normal class and test class?

Best Answer chosen by chinni d
Swayam@SalesforceGuySwayam@SalesforceGuy
Hi

 Apex Class:- its a piece of code which do some task in your application.
in simple if you have written a  piece of code to add two fields. and display that in another field.


 apex class syntax
Public Class add{

     your code..........

}

 
Apex test Class :-its also a piece of code which test the functionality of the apex class.

Ex:-to check the above apex program is performing correctly or not in runtime ,you will write test method by insert in some dummy data and checking the out put in the same class by using system assert function.

 apex test class syntax:-

@isTest

private class add {

static testMethod void add() {

          Your test code...............

   }


Check this link for writing apex class and test classes:-
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_HelloWorld.htm


Hope this helps,

--
Thanks,
Swayam Chouksey
@salesforceguy

All Answers

Swayam@SalesforceGuySwayam@SalesforceGuy
Hi

 Apex Class:- its a piece of code which do some task in your application.
in simple if you have written a  piece of code to add two fields. and display that in another field.


 apex class syntax
Public Class add{

     your code..........

}

 
Apex test Class :-its also a piece of code which test the functionality of the apex class.

Ex:-to check the above apex program is performing correctly or not in runtime ,you will write test method by insert in some dummy data and checking the out put in the same class by using system assert function.

 apex test class syntax:-

@isTest

private class add {

static testMethod void add() {

          Your test code...............

   }


Check this link for writing apex class and test classes:-
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_qs_HelloWorld.htm


Hope this helps,

--
Thanks,
Swayam Chouksey
@salesforceguy
This was selected as the best answer
JAY_PJAY_P

I have two object name is mobile__c and shutdown__c both object have connection to one field bachno_c 
and there are two typs of record mobile1 and mobile2 in the field call module__c 
so for that if record is mobile1 and in shutdown__c we have one field shutdown_type if i put if stop value it will change to start 
for the record mobile2 it will not change anything how to write trigger for that???
HOW TO WRITE TRIGGER FOR THIS ONE PLZ HELP ME