• sekhar raj 4
  • NEWBIE
  • -1 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
trigger CarModelsTrigger on Car_Model__c (before update) {
set<id>smooth=new set<id>();
for(Car_Model__c nd: trigger.new){
if(nd.name!=trigger.old.get(nd.id).name){
smooth.add(nd.id);
}
}

Set<Id>smoothset= new Set<id>();
for(Cars_Showroom__c sho:[Select id,Car_Model__c from Cars_Showroom__c where Car_Model__c in:smooth]){
smoothset.add(sho.Car_Model__c);
}
for(Car_Model__c dr:trigger.new)
{
if(smoothset.contains(dr.Id)){
dr.addError('you cannot delted since associate one');
}
}
}
public class test1
{
public static Integer st=0;
public static void se()
{
st++;
List<string> sj=new List<string>{'sai','revanthi','kalyan','kamal'};
system.debug('list usage'+sj+'withsize'+sj.size());
sj.add('karthika');
system.debug('addelememt'+sj);
system.debug('arry size of get data' +sj.get(3));
sj.remove(3);
system.debug('deleted elements'+sj+ 'elemets list'+sj.size());
sj.set(3,'sekhar');
system.debug('add one element' +sj +'with size' +sj.size());
sj.add('satya');
system.debug('add one element' +sj +'with size' +sj.size());
sj.sort();
system.debug('all elements'+sj);
List<string> sj1=new List<string>();
sj1.addAll(sj);
system.debug(' adding another list'+sj1);
List<string> sj3=sj1.clone();
system.debug('adding multipul elelments'+sj3);
sj3.clear();
system.debug('elements clear in sj3'+sj3 +'is empty'+sj3.isEmpty());
Integer[] num=new Integer[3];
num[0]=122;
num[1]=222;
num[2]=333;
num.add(444);
system.debug('array list'+num);
//Account acc= new Account();
//acc.Name='tiger';
//insert acc;

 Car_Model__c ss=new Car_Model__c(Name='lepord');
  Insert ss;
list<Cars_Showroom__c> show=new <Cars_Showroom__c>();
Cars_Showroom__c ncc=new Cars_Showroom__c();
ncc.Customer_Name__c='rajarama';
ncc.Car_Model__c=ss.Id;
ncc.Name='kiran';
ncc.Customer_Id__c='78787';
show.add(ncc);

Cars_Showroom__c ncc1=new Cars_Showroom__c(
                          Customer_Name__c='rani',Car_Model__c=ss.Id,
                          Name='raju',Customer_Id__c='88888');
                          show.add(ncc1);

Cars_Showroom__c ncc2=new Cars_Showroom__c(
                          Customer_Name__c='sekhar',Car_Model__c=ss.Id,
                          Name='deevi',Customer_Id__c='99999');
                          show.add(ncc2);
        
Cars_Showroom__c ncc3=new Cars_Showroom__c(
                          Customer_Name__c='rani',Car_Model__c=ss.Id,
                          Name='ranga',);
                          show.add(ncc3);
  if(show !=null && show1.size()>0){
  list<Database.saveResult> savreslt = Database.Insert(show,false);
  for(Database.saveResult rt: savreslt){
  if(rt.issucess()){
  System.debug('Successfully inserted employee. Employee ID: ' + rt.getId());
  }
  else{
  for(Database.Error err : rt.getErrors()) {
   System.debug('The following error has occurred.');
   System.debug(err.getStatusCode() + ': ' + err.getMessage());
   System.debug('Employee fields that affected this error: ' + err.getFields());
                    }
                    }
                    }
              }
       }        
        }
 
 
 
public abstract class cellshop
{
public cellshop() 
{
system.debug('jjjjjj');
}
private abstract void cost();
void change()
{system.debug('iiiii');}
 class ab extends cellshop
{
private override void cost()
{system.debug('cell cost7872');
}
}
}
Is it possible to upload entire java project having size 20 MB and to run from salesforce ?if possible than let me know that how can we store (upload) and run java project .Thank You.

I am having trouble finding any documentation on:

 

1.  What is the difference between Abstract and Virtual classes (they seem to be the exact same to me)

 

2. What are some scenarios for using Abstract or Virtual classes (wrapper classes comes to mind but are these the right thing to use?)

 

3.  When would you use an Interface instead of an Abstract or Virtual?  I read they are only suppose to be signatures but I saw an example that had a method with code in it too..

  • July 25, 2013
  • Like
  • 0