• Nageswara reddy
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 43
    Questions
  • 16
    Replies

HI All,

 

 

  I have to  display  objective types questions in my vf page .  I have  created a vf page  with out usging   any object for that   anad working  fine,  But  What my intension is   i need to store all the qustions in my custom Object(qustions)  and generate vf page for dispalying question from object  . wha it is the procedure for createing  qustions in  custom object ( what are the fileds  I need to take  )

HI All,

 

 I have  crated one flow  for upsert operation operations  on accounts and contacts object.  How can  i provide relation between  account and contact  object.  i am able to crate new account  and contact indiviadually and  updating  the account  but i  am unable to  create and upate the child  contacts . how can i achieve. As we know we can't get account id  while updating and deleting an account. any one can help me

 

 

 

Thanks and regards

Hi all

i am new to development, I Have to  craete a flow  for  upsert account and  contacts,. How can  i get the   acconts id's and contacts ,id's from the objetcs  through  flow designer element which element is supprot   to get id's from the objects.  is there any help, help would be appriciated

 

 

Thanks

Nageswara

Hi all,

 

      i am new to development, I Have to  craete a flow  for  upsert account and  contacts,. How can  i get the   acconts id's and contacts ,id's from the objetcs  through  fow designer element,  is there any help,

 

 

Nageswara 

Nageswara reddy

HI am new to development ,
I have created d flow for inserting accounts and contact, flow flow is if I am going to create an account it will lookup account object , if it that account is exist i will update that account other wise crearte new account , its working fine, then i will crerate contact under that account, iam unable to do this,I have created flow for inserting same as account, but i need do after created account i want to create contac under that , and i don' t use any extra filed that is account name inthe cotact form, i can i solve this problem can any one help me.


Nageswara

 

HI am new to development ,
I have created d flow for inserting accounts and contact, flow flow is if I am going to create an account it will lookup account object , if it that account is exist i will update that account other wise crearte new account , its working fine, then i will crerate contact under that account, iam unable to do this,I have created flow for inserting same as account, but i need do after created account i want to create contac under that , and i don' t use any extra filed that is account name inthe cotact form, i can i solve this problem can any one help me.


Nageswara

HI all,

 

       I am   moving  one trigger from   sandbox account  to production. in  production account i have 34,200 contacts are there.  i ma not getting  any error while uploading  . but  I am  getting failure message  in  production  while  validating the chage set. The Fialure message like ""System.LimitException: Too many query rows: 50001", Failure Stack Trace: "(System Code) Trigger.campMemberTrig: line 6, column 1" as my trigger is 

 

trigger campMemberTrig on CampaignMember (before insert, before update) {

Map<Id, Contact> mpCon = new Map<Id, Contact>();
list<contact> conlist=new list<contact>();
for(Contact c: [Select id, name,email,HasOptedOutOfEmail from Contact limti 50000])---------- 6th line   I tried  49000 limit a but //no Use same error iam getting once  
mpcon.put(c.id,c);
id contactid;
for(CampaignMember cm:trigger.New) {
if(cm.status=='Opted Out'&&trigger.isinsert)
contactid=cm.contactid;
else if(trigger.isupdate)
if(trigger.oldmap.get(cm.id).status!='Opted Out'&&cm.status=='Opted Out')
contactid=cm.contactid;
}


If(contactid!=null){
string cemail=mpcon.get(contactid).email;
for(id cid:mpcon.keyset())
{
If(mpcon.get(cid).email==cemail){
mpcon.get(cid).HasOptedOutOfEmail=true;
conlist.add(mpcon.get(cid));
}
}
}
if(conlist.size()>0)
update conlist;

}

 

 

Plz help me out this situation

 

Nageswara 

HI all,

 

       I am   moving  one trigger from   sandbox account  to production. in  production account i have 34,200 contacts are there.  i ma not getting  any error while uploading  . but  I am  getting failure message  in  production  while  validating the chage set. The Fialure message like ""System.LimitException: Too many query rows: 50001", Failure Stack Trace: "(System Code) Trigger.campMemberTrig: line 6, column 1" as my trigger is 

 

trigger campMemberTrig on CampaignMember (before insert, before update) {

Map<Id, Contact> mpCon = new Map<Id, Contact>();
list<contact> conlist=new list<contact>();
for(Contact c: [Select id, name,email,HasOptedOutOfEmail from Contact limti 50000])---------- 6th line   I tried  49000 limit a but //no Use same error iam getting once  
mpcon.put(c.id,c);
id contactid;
for(CampaignMember cm:trigger.New) {
if(cm.status=='Opted Out'&&trigger.isinsert)
contactid=cm.contactid;
else if(trigger.isupdate)
if(trigger.oldmap.get(cm.id).status!='Opted Out'&&cm.status=='Opted Out')
contactid=cm.contactid;
}


If(contactid!=null){
string cemail=mpcon.get(contactid).email;
for(id cid:mpcon.keyset())
{
If(mpcon.get(cid).email==cemail){
mpcon.get(cid).HasOptedOutOfEmail=true;
conlist.add(mpcon.get(cid));
}
}
}
if(conlist.size()>0)
update conlist;

}

 

 

Plz help me out this situation

 

Nageswara 

 

Hi All,

 

   I am  moving  tiggers from sanboz to production  account .  I  production account i have 34,240  records ,   wihile  validate the trigger in production  i am  gettting Error  like Failure Message: "System.LimitException: Too many query rows: 50001", Failure Stack Trace: "(System Code) Trigger.campMemberTrig: line 6, column 1"

 

 

 my trigger is

 

 

 

Trigger:
trigger campMemberTrig on CampaignMember (before insert, before update) {
    
 
    Map<Id, Contact> mpCon = new Map<Id, Contact>();
       list<contact> conlist=new list<contact>();
       for(Contact c: [Select id, name,email,HasOptedOutOfEmail from Contact limit 50000])----------6th line
        mpcon.put(c.id,c);
    id contactid;
     for(CampaignMember  cm:trigger.New)  {
    if(cm.status=='Opted Out'&&trigger.isinsert)
      contactid=cm.contactid; 
    else if(trigger.isupdate)
    if(trigger.oldmap.get(cm.id).status!='Opted Out'&&cm.status=='Opted Out')
    contactid=cm.contactid; 
   } 
  
    is  there any  help to  solve  this error

Hi all,

        I am new to development, what is the wrapper class, how is useful in  visualforce pages and apex classes, any one can help me with  one simple example , help would appreciated

 

 

Thanks,

Nageswar.

 

HI All

 could  please anyone what is exactly meaning  rendered and rerendered attribute  , where this attribute  useful .

HI all,

 

 

 I am facing problem  with string .Split using a semi-colon

 

String address=add2;  

address=Abbyville,null,Kansas,92274&#124;1520 Malley Road,Anchorage,Alaska,99501&#124;

string[] spilt= address.split('\\;'); or String[]split=address.split(';');
for(string s: spilt)
{
system.debug('***********'+s);

}

 

 

 i  am getting like this way

5]
03:18:49.816 (816967000)|HEAP_ALLOCATE|[375]|Bytes:4
03:18:49.817 (817007000)|HEAP_ALLOCATE|[375]|Bytes:8
03:18:49.817 (817015000)|HEAP_ALLOCATE|[375]|Bytes:4
03:18:49.817 (817047000)|HEAP_ALLOCATE|[375]|Bytes:76
03:18:49.817 (817063000)|VARIABLE_SCOPE_BEGIN|[375]|spilt|LIST<String>|true|false
03:18:49.817 (817092000)|VARIABLE_ASSIGNMENT|[375]|spilt|["Abbyville,null,Kansa (48 more) ..."]|0x56145e09
03:18:49.817 (817125000)|SYSTEM_METHOD_ENTRY|[376]|LIST<String>.iterator()
03:18:49.817 (817269000)|SYSTEM_METHOD_EXIT|[376]|LIST<String>.iterator()
03:18:49.817 (817293000)|SYSTEM_METHOD_ENTRY|[376]|system.ListIterator.hasNext()
03:18:49.817 (817309000)|HEAP_ALLOCATE|[376]|Bytes:5
03:18:49.817 (817323000)|SYSTEM_METHOD_EXIT|[376]|system.ListIterator.hasNext()
03:18:49.817 (817339000)|HEAP_ALLOCATE|[376]|Bytes:68
03:18:49.817 (817360000)|VARIABLE_SCOPE_BEGIN|[376]|s|String|false|false
03:18:49.817 (817380000)|VARIABLE_ASSIGNMENT|[376]|s|"Abbyville,null,Kansa (48 more) ..."
03:18:49.817 (817392000)|STATEMENT_EXECUTE|[377]
03:18:49.817 (817403000)|STATEMENT_EXECUTE|[378]
03:18:49.817 (817413000)|HEAP_ALLOCATE|[378]|Bytes:11
03:18:49.817 (817430000)|HEAP_ALLOCATE|[378]|Bytes:79
03:18:49.817 (817445000)|SYSTEM_METHOD_ENTRY|[378]|System.debug(ANY)
03:18:49.817 (817480000)|USER_DEBUG|[378]|DEBUG|***********Abbyville,null,Kansas,92274&#124;1520 Malley Road,Anchorage,Ala

HI all,

 

  String method is not  working  in my apex class  ,

 I have written in my apex class like this

 

String address=add2;
string[] spilt= address.split(';');           
for(string s: spilt)
{
system.debug('***********'+s);

}

 Its  Not spiltting,

 

 Bur same code  when run in  console it will  work

 

String address='Abbyville,null,Kansas,92274&#124;1520 Malley Road,Anchorage,Alaska,99501&#124;';
string[] spilt= address.split(';');
for(string s: spilt)
{
system.debug('***********'+s);
}

 can any one help y it is not spiltting

 

Thanks

Nageswar

 

 

HI all,

 

 I am using geocodes In my apex class to find  distance between  two places.  To find langitude and lattitude  of a place i am using XML parser,   Thex XML parser is not Happening in my code , could u pla tell me  Why it is not, Even though I am placing Googleape geocode in Remote settings.  My apex class is

 

Apex Class

 

public void filtering()
{
If(navilist.size()>0)
navilist.clear();
if(mapval.size()>0)
mapval.clear();
string address22='';
string address11=patient.E_Address1__c+'+'+patient.City__c+'+'+'+'+patient.states__c;
if(patient.zip__C!=null)
address11=patient.E_Address1__c+'+'+patient.City__c+'+'+'+'+patient.states__c+'+'+'+'+patient.zip__C;
if(pat.Type_of_Cancer__c!=null && pat.Gender__c!=null&&Lastname=='')
{
//cancer type and Gender

for(Navigator__c nv:[select fullname__c,zip_code__c,id,E_Navigator_Last_Name__c,name,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Gender__c=:pat.Gender__c and Type_of_Cancer__c=:pat.Type_of_Cancer__c and Assigned_Patients__c<=2 and createdbyid=:userid and Been_Through_Orientation__c=:true])
{

wraperclass w=new wraperclass();
w.id=nv.id;
w.E_Address1=nv.E_Address_1__c;
w.City=nv.city__c;
//w.country=nv.County__c;
w.address=nv.name+';'+nv.E_Address_1__c+'+'+'+'+nv.city__c+'+'+nv.states__C+'+'+nv.Type_of_Cancer__c+';'+nv.E_Navigator_Last_Name__c;
address=w.address;
slist.add(address);
w.addr=nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C; 
w.cancertype=nv.Type_of_Cancer__c;
w.fname=nv.name;
w.lname=nv.E_Navigator_Last_Name__c;
if(nv.zip_code__C!=null)
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'+'+nv.zip_code__c+'|';
else
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'|';
navilist.add(w); 
mapval.put(nv.fullname__c,nv.id);
}

coordinates(address11,address22);
}
else if(pat.Type_of_Cancer__c!=null && pat.Gender__c==null&&Lastname=='')
{
//only for type of cancer
for(Navigator__c nv:[select fullname__c,id,zip_code__c,E_Navigator_Last_Name__c,name,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Type_of_Cancer__c=:pat.Type_of_Cancer__c and Assigned_Patients__c<=2 and createdbyid=:userid and Been_Through_Orientation__c=:true])
{
wraperclass w=new wraperclass();
w.id=nv.id;
w.E_Address1=nv.E_Address_1__c;
w.City=nv.city__c;
//w.country=nv.County__c;
w.address=nv.name+';'+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+';'+nv.Type_of_Cancer__c+';'+nv.E_Navigator_Last_Name__c;
address=w.address;
slist.add(address);
w.addr=nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C; 
w.cancertype=nv.Type_of_Cancer__c;
w.fname=nv.name;
w.lname=nv.E_Navigator_Last_Name__c;
if(nv.zip_code__C!=null)
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'+'+nv.zip_code__c+'|';
else
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+','+nv.states__C+'|';
navilist.add(w); 
mapval.put(nv.fullname__c,nv.id);
}

coordinates(address11,address22);
}
else if(pat.Type_of_Cancer__c!=null && pat.Gender__c==null &&Lastname!='')
{
//cancertype and lastname
for(Navigator__c nv:[select fullname__c,id,zip_code__c,E_Navigator_Last_Name__c,name,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Last_name__C=:Lastname and Type_of_Cancer__c=:pat.Type_of_Cancer__c and Assigned_Patients__c<=2 and createdbyid=:userid and Been_Through_Orientation__c=:true])
{
wraperclass w=new wraperclass();
w.id=nv.id;
w.E_Address1=nv.E_Address_1__c;
w.City=nv.city__c;
//w.country=nv.County__c;
w.address=nv.name+';'+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+';'+nv.Type_of_Cancer__c+';'+nv.E_Navigator_Last_Name__c;
address=w.address;
slist.add(address);
w.addr=nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C; 
w.cancertype=nv.Type_of_Cancer__c;
w.fname=nv.name;
w.lname=nv.E_Navigator_Last_Name__c;
if(nv.zip_code__C!=null)
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'+'+nv.zip_code__c+'|';
else
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'|';
navilist.add(w); 
mapval.put(nv.fullname__c,nv.id);
}

coordinates(address11,address22);
}
else if(pat.Type_of_Cancer__c==null && pat.Gender__c==null &&Lastname!='')
{
//only lastname 
for(Navigator__c nv:[select fullname__c,id,zip_code__c,E_Navigator_Last_Name__c,name,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Last_name__C=:Lastname and Assigned_Patients__c<=2 and createdbyid=:userid and Been_Through_Orientation__c=:true])
{
wraperclass w=new wraperclass();
w.id=nv.id;
w.E_Address1=nv.E_Address_1__c;
w.City=nv.city__c;
//w.country=nv.County__c;
w.address=nv.name+';'+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+';'+nv.Type_of_Cancer__c+';'+nv.E_Navigator_Last_Name__c;
address=w.address;
slist.add(address);
w.addr=nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C; 
w.cancertype=nv.Type_of_Cancer__c;
w.fname=nv.name;
w.lname=nv.E_Navigator_Last_Name__c;
if(nv.zip_code__C!=null)
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'+'+nv.zip_code__c+'|';
else
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+','+nv.states__C+'|';
navilist.add(w); 
mapval.put(nv.fullname__c,nv.id);
}

coordinates(address11,address22);
}
else if(pat.Type_of_Cancer__c==null && pat.Gender__c!=null &&Lastname!='')
{
//lastname and gender
for(Navigator__c nv:[select fullname__c,id,zip_code__c,E_Navigator_Last_Name__c,name,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Last_name__C=:Lastname and Gender__c=:pat.Gender__c and Assigned_Patients__c<=2 and createdbyid=:userid and Been_Through_Orientation__c=:true])
{
wraperclass w=new wraperclass();
w.id=nv.id;
w.E_Address1=nv.E_Address_1__c;
w.City=nv.city__c;
//w.country=nv.County__c;
w.address=nv.name+';'+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+';'+nv.Type_of_Cancer__c+';'+nv.E_Navigator_Last_Name__c;
address=w.address;
slist.add(address);
w.addr=nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C; 
w.cancertype=nv.Type_of_Cancer__c;
w.fname=nv.name;
w.lname=nv.E_Navigator_Last_Name__c;
if(nv.zip_code__C!=null)
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+','+nv.zip_code__c+'|';
else
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'|';
navilist.add(w);
mapval.put(nv.fullname__c,nv.id); 
}coordinates(address11,address22);
}
else if(pat.Type_of_Cancer__c==null && pat.Gender__c!=null &&Lastname=='')
{
//only gender
for(Navigator__c nv:[select fullname__c,id,zip_code__c,E_Navigator_Last_Name__c,name,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Gender__c=:pat.Gender__c and Assigned_Patients__c<=2 and createdbyid=:userid and Been_Through_Orientation__c=:true])
{
wraperclass w=new wraperclass();
w.id=nv.id;
w.E_Address1=nv.E_Address_1__c;
w.City=nv.city__c;
//w.country=nv.County__c;
w.address=nv.name+';'+nv.E_Address_1__c+','+nv.city__c+','+nv.states__C+';'+nv.Type_of_Cancer__c+';'+nv.E_Navigator_Last_Name__c;
address=w.address;
slist.add(address);
w.addr=nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C; 
w.cancertype=nv.Type_of_Cancer__c;
w.fname=nv.name;
w.lname=nv.E_Navigator_Last_Name__c;
if(nv.zip_code__C!=null)
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'+'+nv.zip_code__c+'|';
else
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'|';
navilist.add(w); 
mapval.put(nv.fullname__c,nv.id);
}
coordinates(address11,address22);
}
else if(pat.Type_of_Cancer__c!=null && pat.Gender__c!=null &&Lastname!='')
{
//gender and cancertype and lastname
for(Navigator__c nv:[select fullname__c,id,zip_code__c,E_Navigator_Last_Name__c,name,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Last_name__C=:Lastname and Gender__c=:pat.Gender__c and Type_of_Cancer__c=:pat.Type_of_Cancer__c and Assigned_Patients__c<=2 and createdbyid=:userid and Been_Through_Orientation__c=:true])
{
wraperclass w=new wraperclass();
w.id=nv.id;
w.E_Address1=nv.E_Address_1__c;
w.City=nv.city__c;
//w.country=nv.County__c;
w.address=nv.name+';'+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+';'+nv.Type_of_Cancer__c+';'+nv.E_Navigator_Last_Name__c;
address=w.address;
slist.add(address);
w.addr=nv.E_Address_1__c+','+nv.city__c+','+nv.states__C; 
w.cancertype=nv.Type_of_Cancer__c;
w.fname=nv.name;
w.lname=nv.E_Navigator_Last_Name__c;
if(nv.zip_code__C!=null)
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+','+nv.zip_code__c+'|';
else
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'|';
navilist.add(w); 
mapval.put(nv.fullname__c,nv.id);
}
coordinates(address11,address22);
}


}
map<string,id> mapval=new map<string,id>();
public void selectall()
{
If(navilist.size()>0)
navilist.clear();
string address22='';
for(Navigator__c nv:[select fullname__c,id,zip_code__c,name,E_Navigator_Last_Name__c ,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Assigned_Patients__c<=2 and createdbyid=:userid and Been_Through_Orientation__c=:true])
{
wraperclass w=new wraperclass();
w.id=nv.id;
w.E_Address1=nv.E_Address_1__c;
w.City=nv.city__c;
//w.country=nv.County__c;
w.address=nv.name+';'+nv.E_Address_1__c+','+nv.city__c+','+nv.states__C+';'+nv.Type_of_Cancer__c+';'+nv.E_Navigator_Last_Name__c;
address=w.address;
slist.add(address);
w.addr=nv.E_Address_1__c+','+nv.city__c+','+nv.states__C; 
w.cancertype=nv.Type_of_Cancer__c;
w.fname=nv.name;
w.lname=nv.E_Navigator_Last_Name__c;
if(nv.zip_code__C!=null)
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'+'+nv.zip_code__c+'|';
else
address22=address22+nv.E_Address_1__c+'+'+nv.city__c+'+'+nv.states__C+'|';
navilist.add(w); 
mapval.put(nv.fullname__c,nv.id);

}
string address11=patient.E_Address1__c+'+'+patient.City__c+'+'+patient.states__c; 
if(patient.zip__C!=null)
address11=patient.E_Address1__c+'+'+patient.City__c+'+'+patient.states__c+'+'+patient.zip__C;
coordinates(address11,address22);


}
public String valueOne{get; set;}
public String valuetwo{get; set;}
public string valuethree{get;set;}
public void finding()
{
valueOne =Apexpages.currentPage().getParameters().get('one');
valuetwo =Apexpages.currentPage().getParameters().get('two');
valuethree =Apexpages.currentPage().getParameters().get('three');
system.debug('hhhhhhhhhhhhhhhhhh'+valueone);
selection=false;

}

public list<wraperclass> getnavilist()
{
return navilist;

// public static boolean isApexTest = false;
public string Coordinates(string add1 ,string add2)
{

// finding Lang and lattitude for Aaddress1
System.debug('@@@@@@@@@@@@@@@@@'+add1);
System.debug('@@@@@@@@@@@@@@@@@@@'+add2);


string url='http://maps.googleapis.com/maps/api/geocode/xml?address=add1&sensor=true';
System.debug('************************'+url);
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setHeader('Content-type', 'application/x-www-form-urlencoded');
req.setHeader('Content-length', '0');
req.setEndpoint(url);
req.setMethod('POST');
HttpResponse res= h.send(req);
string responseBody = res.getBody().replace('\n','');
system.debug('++++++++++++++++++++++'+responseBody);
dom.Document doc= res.getBodyDocument();
//getting Root Element
dom.XmlNode rootElement = doc.getRootElement();
system.debug('+++++++++++++++'+ rootElement ); 
dom.XMLNode resultElement= rootElement.getChildElement('result',null);
system.debug('&&&&&&&&&&&&&&&&&&&&&&&&&&'+resultElement );
dom.XMLNode geometryElement =resultElement.getChildElement('geometry',null);
system.debug('$$$$$$$$$$$$$$$$$$$$$$$$$$'+geometryElement );
dom.XMLNode locationElement = geometryElement.getChildElement( 'location',null);
system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+ locationElement );
String lat =locationElement.getChildElement('lat', null).getText();
string lng = locationElement.getChildElement('lng', null).getText();
System.debug('%%%%%%%%%%%%%%%%%%%%%%'+lat);
System.debug('#####################'+lng);
double dlat= double.valueof(lat);
double dlng= double.valueof(lng);
System.debug('----------------------'+dlat);
System.debug('----------------------'+dlng);

//finding Lang and lattitude for Aaddress2
string url1='http://maps.googleapis.com/maps/api/geocode/xml?address=add2&sensor=true';
System.debug('************************'+url1);

Http h1 = new Http();
HttpRequest req1 = new HttpRequest();
req1.setHeader('Content-type', 'application/x-www-form-urlencoded');
req1.setHeader('Content-length', '0');
req1.setEndpoint(url1);
req1.setMethod('POST');
HttpResponse res1 = h.send(req1);
string responseBody1 = res1.getBody().replace('\n','');
system.debug('++++++++++++++++++++++'+responseBody);
dom.Document doc1= res1.getBodyDocument();
dom.XmlNode rootElement1 = doc1.getRootElement();
system.debug('+++++++++++++++'+ rootElement1 );
dom.XMLNode resultElement1= rootElement1.getChildElement('result',null);
system.debug('&&&&&&&&&&&&&&&&&&&&&&&&&&'+resultElement1 );
dom.XMLNode geometryElement1 =resultElement1.getChildElement('geometry',null);
system.debug('$$$$$$$$$$$$$$$$$$$$$$$$$$'+geometryElement1 );
dom.XMLNode locationElement1 = geometryElement1.getChildElement( 'location',null);
system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+ locationElement1 );
String lat1 =locationElement1.getChildElement('lat', null).getText();
string lng1= locationElement1.getChildElement('lng', null).getText();
System.debug('%%%%%%%%%%%%%%%%%%%%%%'+lat1);
System.debug('#####################'+lng1);
double dlat1= double.valueof(lat1);
double dlng1= double.valueof(lng1);
System.debug('----------------------'+dlat1);
System.debug('----------------------'+dlng1);

//finding distance between Two locations using long and lattitude of Two palces
String retvalue;
double dLat1InRad = dlat* (3.14 / 180.0);
double dLong1InRad = dlng* (3.14 / 180.0);
double dLat2InRad = dlat1 * (3.14 / 180.0);
double dLong2InRad = dlng1 * (3.14 / 180.0);
double dLongitude = dLong2InRad - dLong1InRad;
system.debug('&&&&&&&&&&&&&&&&'+dLongitude);
double dLatitude = dLat2InRad - dLat1InRad;
double a = Math.Sin(dLatitude / 2.0)*Math.Sin(dLatitude / 2.0) + 
Math.Cos(dLat1InRad) * Math.Cos(dLat2InRad) * 
Math.Sin(dLongitude / 2.0)*Math.Sin(dLongitude / 2.0);
System.debug('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'+a);
double c = 2.0 * Math.Asin(Math.Sqrt(a));

Double kEarthRadiusMiles = 3956.0;
// Double kEarthRadiusKms = 6376.5;
retvalue = String.valueof( kEarthRadiusMiles * c);
//system.debug('^^^^^^^^^^^^^^^^^^^^^^^^^^'+dDistance);
system.debug('*********'+retvalue);
navclass w=new navclass();
//w.distanceval=1;
if(retvalue.substring(retvalue.length()-2,retvalue.length())=='mi'||retvalue.substring(retvalue.length()-2,retvalue.length())=='ft')
{
/* sample=string.valueof(retvalue);

retValue=retValue.replace(',','');
integer value=integer.valueof(retValue.substring(0,retValue.length()-3)); 
w.distanceval=value*0.62; */
w.distanceval= retValue;
integer i=0;
w.address=navilist.get(i).addr;
w.cancertype=navilist.get(i).cancertype;
w.firstname=navilist.get(i).fname;
w.lastname=navilist.get(i).lname;
w.id=navilist.get(i).id;
wlist.add(w);
system.debug('+++++++'+retvalue);
i++;
}




// }
// reader.next();

//}
string sample=string.valueof(wlist);
system.debug('************'+wlist);
return null;
}
list<navclass> wlist=new list<navclass>();
public list<navclass> getwlist()
{
return wlist;
}
public void selectedone()
{
integer i=0;
for(navclass n:wlist)
{
if(n.isSelected==true)
{
Navigator__c nv=[select id,E_Navigator_Last_Name__c from Navigator__c where id=:n.id];
patient.Assigned_Navigator__c=nv.id;
patient.Navigator_Last_Name__c=nv.E_Navigator_Last_Name__c;
patient.Distance__c=string.valueof(n.distanceval);
break;
}

i++;

}
wlist.remove(i);

}
public class navclass
{
public string timeval{set;get;}
public string distanceval{set;get;}
public string address{set;get;}
public string lastName{set;get;}
public string firstname{set;get;}
public string cancertype{set;get;}
public id id{set;get;}
public boolean isSelected{set;get;}
}


}

 

HI All,

   

          I have  one custom field that is Rollupsummery  field ,  when i am going to Create a report  in Sand box Account that Rollup Summery field is not availbe  to drag., but it availbe in Inmy developer edition., I am not getting this why it is not coming Any body can help to Come out this

 

 

Thanks 

Nageswar

HI All,

   

          I have  one custom field that is Rollupsummery  field ,  when i am going to Create a report  in Sand box Account that Rollup Summery field is not availbe  to drag., but it availbe in Inmy developer edition., I am not getting this why it is not coming Any body can help to Come out this

 

Thanks 

Nageswar

Hi all,

 

       I am new developer , i need to write test class for for the follwing class

 

apex calss is

----------------------------------

public class startHereController {

    public PageReference initPageAction() {
        if (this.theXMlDom == null) {
            PageReference homePage= new PageReference('/home/home.jsp');
            homePage.setRedirect(true);  
            return homePage;
        } else {
            return null;
        }
    }

    // Class variables
    XmlStreamReader reader;
    xmldom theXMLDom;        

    // Constructor
    public startHereController () {
        init(); 
    }
    
    public void init() {
        String lang = UserInfo.getLanguage();
        lang = lang.subString(0, 2);
        
        //Get the XML document from the external server 
        Http http       = new Http(); 
        HttpRequest req = new HttpRequest(); 

        try {        
            req.setEndpoint('http://www.apexdevnet.com/ootbe/starthere/catalog_'+lang+'.xml'); 
            req.setMethod('GET'); 
            
            HttpResponse res = http.send(req); 
            
            if (res.getStatusCode() == 404) {
                // Default to English if language doesn't exist
                req.setEndpoint('http://www.apexdevnet.com/ootbe/starthere/catalog_en.xml'); 
                req.setMethod('GET'); 
            
                res = http.send(req); 
            }
            this.theXMLDom = new xmldom(res.getBody());
        } catch (Exception e) {
            this.theXMLDom = null;
        }
    } 
    
    public String getHTMLHeader() {
        if (this.theXMLDom != null && this.theXMLDom.getElementsByTagName('htmlheader') != null) {
            return this.theXMLDom.getElementsByTagName('htmlheader')[0].nodeValue;
        } else {
            return '';
        }
    }

    public String getBannerURL() {
        if (this.theXMLDom != null && this.theXMLDom.getElementsByTagName('bannerURL') != null) {
            return this.theXMLDom.getElementsByTagName('bannerURL')[0].nodeValue;
        } else {
            return '';
        }
    }

    public String getBannerImageURL() {
        if (this.theXMLDom != null && this.theXMLDom.getElementsByTagName('bannerImageURL') != null) {
            return this.theXMLDom.getElementsByTagName('bannerImageURL')[0].nodeValue;
        } else {
            return '';
        }
    }
    
    public String getMainBody() {
        if (this.theXMLDom != null && this.theXMLDom.getElementsByTagName('main') != null) {
            return this.theXMLDom.getElementsByTagName('main')[0].nodeValue;
        } else {
            return '';
        }
    }
        
    public String getSideBar() {
        if (this.theXMLDom != null && this.theXMLDom.getElementsByTagName('sidebar') != null) {
            return this.theXMLDom.getElementsByTagName('sidebar')[0].nodeValue;
        } else {
            return '';
        }        
    }
    
    public String getFooter() {
        if (this.theXMLDom != null && this.theXMLDom.getElementsByTagName('footer') != null) {
            return this.theXMLDom.getElementsByTagName('footer')[0].nodeValue;
        } else {
            return '';
        }
    }
    
    public String getTracker() {
        if (this.theXMLDom != null && this.theXMLDom.getElementsByTagName('tracker') != null) {
            return this.theXMLDom.getElementsByTagName('tracker')[0].nodeValue;
        } else {
            return '';
        }
    }    
}

 Any one can help me 

 

Thnaks Nageswar

HI,

  while writting test clla I ma getting error like Argument 1 cannot be null: External entry point in test Class,

 

My test code is

 

@isTest
private class TestAIOlineitems
{
static TestMethod void testAI01Line()
{

AIOlineitems.wrappo w=new AIOlineitems.wrappo();

Products__c p=new Products__c(name='xxxxx',Price__c=2334.78);
insert p;
Purchase_Order__c po=new Purchase_Order__c();
insert po;
Availability_In_Order__c ava =new Availability_In_Order__c(Purchase_Order__c=po.id);
insert ava;
Availability_In_Order_Lineitems__c ao=new Availability_In_Order_Lineitems__c(Availability_In_Order__c=ava.id,Products__c=p.id);
insert ao;
ApexPages.Currentpage().getParameters().put('id',ava.ID);

ApexPages.StandardController sc = new ApexPages.StandardController(ava);
AIOlineitems ai=new AIOlineitems(sc);
ai.Cancelpoedit();
ai.getproducts1();
ai.newPoline();
ai.poedit=ApexPages.Currentpage().getParameters().put('editid',ao.ID);
ai.sno=5;
ai.editprodu();

//ai.edu='aaaa';
//PageReference pag=new PageReference();
PageReference nextPage= ai.savepoedit();
PageReference nextPage1= ai.deleteprodu();

}
}

-------------------------------

apex class is

 

public class AIOlineitems {
public boolean check{set;get;}
id pid;
public boolean Newpol{set;get;}
public Integer sno{set;get;}
public Id poedit{set;get;}
public Availability_In_Order_Lineitems__c newPO{set;get;}
public Id poid{set;get;}
public map<id,Availability_In_Order_Lineitems__c> polmap{set;get;}
public Id productname{set;get;}
public integer cou{set;get;}
public List<SelectOption> productlist{set;get;}
public Availability_In_Order_Lineitems__c edu{set;get;}
public list<wrappo> POlist{set;get;}
public class wrappo{
public Availability_In_Order_Lineitems__c pol{set;get;}
public boolean newp{set;get;}
public integer no{set;get;}
public wrappo(){
pol=new Availability_In_Order_Lineitems__c();
newp=false;
}
}
    public AIOlineitems(ApexPages.StandardController controller) {
    productlist=new List<SelectOption>();
     polmap=new map<id,Availability_In_Order_Lineitems__c>();
    for(products__c p:[select id,Name from products__c ORDER BY Name DESC limit 1000])
    productlist.add(new SelectOption(p.Id,p.Name));
NewPol=false;
PoId=Apexpages.currentpage().getParameters().get('id');
POlist=new list<wrappo>();
cou=0;
general();

    }
    public void Cancelpoedit(){
    edu=null;
    }
    public void general(){
    edu=null;
    if(polist.size()>0)
    polist.clear();
for(Availability_In_Order_Lineitems__c pol:[select Id,Name,Products__c,Products__r.name,Ordered_Quantity__c,Available_Quantity__c,Total_Product_price__c  from Availability_In_Order_Lineitems__c where Availability_In_Order__c=:poid ORDER BY Name DESC limit 1000])
{
wrappo w=new wrappo();
w.pol=pol;
w.newp=false;
w.no=cou+1;
cou=cou+1;
polmap.put(pol.id,pol);
polist.add(w);

}
for(Availability_In_Order__C a:[select id,Purchase_Order__c from Availability_In_Order__C where id=:poid])
pid=a.Purchase_Order__c;
Purchase_Order__c p1=[select id,Available_Order_Accepted_by_executive__c from Purchase_Order__c where id=:pid];
check=p1.Available_Order_Accepted_by_executive__c;
}
    public List<SelectOption> getproducts1(){
return productlist;
}
    Public void newPoline(){
   wrappo w=new wrappo();
   
    newpo=new Availability_In_Order_Lineitems__c();
    w.pol=newpo;
    w.newp=true;
    w.no=cou+1;
cou=cou+1;
    polist.add(w);
    }
    
    public void editprodu(){
     poedit=Apexpages.currentpage().getParameters().get('editid');
     edu=polmap.get(poedit);
     productname=edu.products__c;
    sno=Integer.valueof(Apexpages.currentpage().getParameters().get('sno'));
    }
public pagereference savepoedit(){
pagereference p;
if(edu!=null){
If(edu.products__c!=productname)
edu.products__c=productname;
update edu;
polist[sno-1].newp=false;
}
else{
polist[cou-1].pol.Availability_In_Order__c=poid;
polist[cou-1].pol.Products__c=productname;
insert polist[cou-1].pol;
polist[cou-1].newp=false;
}
general();
p=new pagereference('/'+poid);
return p;
}
public pagereference deleteprodu(){
pagereference p;
   poedit=Apexpages.currentpage().getParameters().get('deid');
     Availability_In_Order_Lineitems__c delpo=polmap.get(poedit);
     if(delpo!=null)
     delete delpo;
     //polist.clear();
     p=new pagereference('/'+poid);
    //general();
    return p;
}
} this  red mark  colour code is not  covering;

 

 

HI All,

 

           I am getting  System.NullPointerException: Attempt to de-reference a null object in test coverage my 

 My apex class is

 

public class AIOlineitems {
public boolean check{set;get;}
id pid;
public boolean Newpol{set;get;}
public Integer sno{set;get;}
public Id poedit{set;get;}
public Availability_In_Order_Lineitems__c newPO{set;get;}
public Id poid{set;get;}
public map<id,Availability_In_Order_Lineitems__c> polmap{set;get;}
public Id productname{set;get;}
public integer cou{set;get;}
public List<SelectOption> productlist{set;get;}
public Availability_In_Order_Lineitems__c edu{set;get;}
public list<wrappo> POlist{set;get;}
public class wrappo{
public Availability_In_Order_Lineitems__c pol{set;get;}
public boolean newp{set;get;}
public integer no{set;get;}
public wrappo(){
pol=new Availability_In_Order_Lineitems__c();
newp=false;
}
}
    public AIOlineitems(ApexPages.StandardController controller) {
    productlist=new List<SelectOption>();
     polmap=new map<id,Availability_In_Order_Lineitems__c>();
    for(products__c p:[select id,Name from products__c ORDER BY Name DESC limit 1000])
    productlist.add(new SelectOption(p.Id,p.Name));
NewPol=false;
PoId=Apexpages.currentpage().getParameters().get('id');
POlist=new list<wrappo>();
cou=0;
general();

    }
    public void Cancelpoedit(){
    edu=null;
    }
    public void general(){
    edu=null;
    if(polist.size()>0)
    polist.clear();
for(Availability_In_Order_Lineitems__c pol:[select Id,Name,Products__c,Products__r.name,Ordered_Quantity__c,Available_Quantity__c,Total_Product_price__c  from Availability_In_Order_Lineitems__c where Availability_In_Order__c=:poid ORDER BY Name DESC limit 1000])
{
wrappo w=new wrappo();
w.pol=pol;
w.newp=false;
w.no=cou+1;
cou=cou+1;
polmap.put(pol.id,pol);
polist.add(w);

}
for(Availability_In_Order__C a:[select id,Purchase_Order__c from Availability_In_Order__C where id=:poid])
pid=a.Purchase_Order__c;
Purchase_Order__c p1=[select id,Available_Order_Accepted_by_executive__c from Purchase_Order__c where id=:pid];
check=p1.Available_Order_Accepted_by_executive__c;
}
    public List<SelectOption> getproducts1(){
return productlist;
}
    Public void newPoline(){
   wrappo w=new wrappo();
   
    newpo=new Availability_In_Order_Lineitems__c();
    w.pol=newpo;
    w.newp=true;
    w.no=cou+1;
cou=cou+1;
    polist.add(w);
    }
    
    public void editprodu(){
     poedit=Apexpages.currentpage().getParameters().get('editid');
     edu=polmap.get(poedit);
     productname=edu.products__c;
    sno=Integer.valueof(Apexpages.currentpage().getParameters().get('sno'));///here the i ma getting error.
    }
public pagereference savepoedit(){
pagereference p;
if(edu!=null){
If(edu.products__c!=productname)
edu.products__c=productname;
update edu;
polist[sno-1].newp=false;
}
else{
polist[cou-1].pol.Availability_In_Order__c=poid;
polist[cou-1].pol.Products__c=productname;
insert polist[cou-1].pol;
polist[cou-1].newp=false;
}
general();
p=new pagereference('/'+poid);
return p;
}
public pagereference deleteprodu(){
pagereference p;
   poedit=Apexpages.currentpage().getParameters().get('deid');
     Availability_In_Order_Lineitems__c delpo=polmap.get(poedit);
     if(delpo!=null)
     delete delpo;
     //polist.clear();
     p=new pagereference('/'+poid);
    //general();
    return p;
}My test class is

 

@isTest
private class TestAIOlineitems
{
static TestMethod void testAI01Line()
{

AIOlineitems.wrappo w=new AIOlineitems.wrappo();
ApexPages.Currentpage().getParameters().put('sno','1234');
Products__c p=new Products__c(name='xxxxx');
insert p;
Purchase_Order__c po=new Purchase_Order__c();
insert po;
Availability_In_Order__c ava =new Availability_In_Order__c(Purchase_Order__c=po.id);
insert ava;
Availability_In_Order_Lineitems__c ao=new Availability_In_Order_Lineitems__c(Availability_In_Order__c=ava.id,Products__c=p.id);
insert ao;
ApexPages.Currentpage().getParameters().put('id',ava.ID);

ApexPages.StandardController sc = new ApexPages.StandardController(ava);
AIOlineitems ai=new AIOlineitems(sc);
ai.Cancelpoedit();
ai.getproducts1();
ai.newPoline();

ApexPages.Currentpage().getParameters().put('sno','1234');
ai.editprodu();
PageReference nextPage= ai.savepoedit();
PageReference nextPage1= ai.deleteprodu();

}
}


 


 any one can help 

 


Hi alll,

  I Have witten test Calss  for apex class It covers 71%,

 

@isTest
private class TestAIOlineitems
{
static TestMethod void testAI01Line()
{
AIOlineitems.wrappo w=new AIOlineitems.wrappo();
Products__c p=new Products__c(name='xxxxx');
insert p;
Purchase_Order__c po=new Purchase_Order__c();
insert po;
Availability_In_Order__c ava =new Availability_In_Order__c(Purchase_Order__c=po.id);
insert ava;
Availability_In_Order_Lineitems__c ao=new Availability_In_Order_Lineitems__c(Availability_In_Order__c=ava.id,Products__c=p.id);
insert ao;
ApexPages.Currentpage().getParameters().put('id',ava.ID);

ApexPages.StandardController sc = new ApexPages.StandardController(ao);
AIOlineitems ai=new AIOlineitems(sc);
ai.Cancelpoedit();
ai.getproducts1();
ai.newPoline();
ApexPages.Currentpage().getParameters().put('id',ao.ID);
ai.editprodu();
ai.savepoedit();
ai.deleteprodu();

}

----------------------------------------------

 The apex class is

-------------------------------------------------------------

public class AIOlineitems {
public boolean check{set;get;}
id pid;
public boolean Newpol{set;get;}
public Integer sno{set;get;}
public Id poedit{set;get;}
public Availability_In_Order_Lineitems__c newPO{set;get;}
public Id poid{set;get;}
public map<id,Availability_In_Order_Lineitems__c> polmap{set;get;}
public Id productname{set;get;}
public integer cou{set;get;}
public List<SelectOption> productlist{set;get;}
public Availability_In_Order_Lineitems__c edu{set;get;}
public list<wrappo> POlist{set;get;}
public class wrappo{
public Availability_In_Order_Lineitems__c pol{set;get;}
public boolean newp{set;get;}
public integer no{set;get;}
public wrappo(){
pol=new Availability_In_Order_Lineitems__c();
newp=false;
}
}
    public AIOlineitems(ApexPages.StandardController controller) {
    productlist=new List<SelectOption>();
     polmap=new map<id,Availability_In_Order_Lineitems__c>();
    for(products__c p:[select id,Name from products__c ORDER BY Name DESC limit 1000])
    productlist.add(new SelectOption(p.Id,p.Name));
NewPol=false;
PoId=Apexpages.currentpage().getParameters().get('id');
POlist=new list<wrappo>();
cou=0;
general();

    }
    public void Cancelpoedit(){
    edu=null;
    }
    public void general(){
    edu=null;
    if(polist.size()>0)
    polist.clear();
for(Availability_In_Order_Lineitems__c pol:[select Id,Name,Products__c,Products__r.name,Ordered_Quantity__c,Available_Quantity__c,Total_Product_price__c  from Availability_In_Order_Lineitems__c where Availability_In_Order__c=:poid ORDER BY Name DESC limit 1000])
{
wrappo w=new wrappo();
w.pol=pol;
w.newp=false;
w.no=cou+1;
cou=cou+1;
polmap.put(pol.id,pol);
polist.add(w);

}
for(Availability_In_Order__C a:[select id,Purchase_Order__c from Availability_In_Order__C where id=:poid])
pid=a.Purchase_Order__c;
Purchase_Order__c p1=[select id,Available_Order_Accepted_by_executive__c from Purchase_Order__c where id=:pid];
check=p1.Available_Order_Accepted_by_executive__c;
}
    public List<SelectOption> getproducts1(){
return productlist;
}
    Public void newPoline(){
   wrappo w=new wrappo();
   
    newpo=new Availability_In_Order_Lineitems__c();
    w.pol=newpo;
    w.newp=true;
    w.no=cou+1;
cou=cou+1;
    polist.add(w);
    }
    
    public void editprodu(){
     poedit=Apexpages.currentpage().getParameters().get('editid');
     edu=polmap.get(poedit);
     productname=edu.products__c;
    sno=Integer.valueof(Apexpages.currentpage().getParameters().get('sno'));
    }
public pagereference savepoedit(){
pagereference p;
if(edu!=null){
If(edu.products__c!=productname)
edu.products__c=productname;
update edu;
polist[sno-1].newp=false;
}
else{
polist[cou-1].pol.Availability_In_Order__c=poid;
polist[cou-1].pol.Products__c=productname;
insert polist[cou-1].pol;
polist[cou-1].newp=false;
}
general();
p=new pagereference('/'+poid);
return p;
}
public pagereference deleteprodu(){
pagereference p;
   poedit=Apexpages.currentpage().getParameters().get('deid');
     Availability_In_Order_Lineitems__c delpo=polmap.get(poedit);
     if(delpo!=null)
     delete delpo;
     //polist.clear();
     p=new pagereference('/'+poid);
    //general();
    return p;
}
}

 

 this code is not covering rajesh can help me to  cover that code

HI ALL,

 

          I am new to devleopment.  i have  one custom filed in  account  named as 'NoofContacts ' data type is Integer,  i need tigger code  how many contacts are there in particular account, when i am inserting one contact in particular account, hte noofcontact fileld  in account increased one automatically, same as delete contact, the noofcontact  will be decreased, i am able  to do this, but i am logged ate updating the contact , if  i update the contact ,i will change the account,then old acocunt noofcontact filed  willbe decreased by one and new account noofcontacts filed is deleted by one, iam logged here ,plz any one help

 

HI all,

 

 

 I am facing problem  with string .Split using a semi-colon

 

String address=add2;  

address=Abbyville,null,Kansas,92274&#124;1520 Malley Road,Anchorage,Alaska,99501&#124;

string[] spilt= address.split('\\;'); or String[]split=address.split(';');
for(string s: spilt)
{
system.debug('***********'+s);

}

 

 

 i  am getting like this way

5]
03:18:49.816 (816967000)|HEAP_ALLOCATE|[375]|Bytes:4
03:18:49.817 (817007000)|HEAP_ALLOCATE|[375]|Bytes:8
03:18:49.817 (817015000)|HEAP_ALLOCATE|[375]|Bytes:4
03:18:49.817 (817047000)|HEAP_ALLOCATE|[375]|Bytes:76
03:18:49.817 (817063000)|VARIABLE_SCOPE_BEGIN|[375]|spilt|LIST<String>|true|false
03:18:49.817 (817092000)|VARIABLE_ASSIGNMENT|[375]|spilt|["Abbyville,null,Kansa (48 more) ..."]|0x56145e09
03:18:49.817 (817125000)|SYSTEM_METHOD_ENTRY|[376]|LIST<String>.iterator()
03:18:49.817 (817269000)|SYSTEM_METHOD_EXIT|[376]|LIST<String>.iterator()
03:18:49.817 (817293000)|SYSTEM_METHOD_ENTRY|[376]|system.ListIterator.hasNext()
03:18:49.817 (817309000)|HEAP_ALLOCATE|[376]|Bytes:5
03:18:49.817 (817323000)|SYSTEM_METHOD_EXIT|[376]|system.ListIterator.hasNext()
03:18:49.817 (817339000)|HEAP_ALLOCATE|[376]|Bytes:68
03:18:49.817 (817360000)|VARIABLE_SCOPE_BEGIN|[376]|s|String|false|false
03:18:49.817 (817380000)|VARIABLE_ASSIGNMENT|[376]|s|"Abbyville,null,Kansa (48 more) ..."
03:18:49.817 (817392000)|STATEMENT_EXECUTE|[377]
03:18:49.817 (817403000)|STATEMENT_EXECUTE|[378]
03:18:49.817 (817413000)|HEAP_ALLOCATE|[378]|Bytes:11
03:18:49.817 (817430000)|HEAP_ALLOCATE|[378]|Bytes:79
03:18:49.817 (817445000)|SYSTEM_METHOD_ENTRY|[378]|System.debug(ANY)
03:18:49.817 (817480000)|USER_DEBUG|[378]|DEBUG|***********Abbyville,null,Kansas,92274&#124;1520 Malley Road,Anchorage,Ala

HI all,

 

  String method is not  working  in my apex class  ,

 I have written in my apex class like this

 

String address=add2;
string[] spilt= address.split(';');           
for(string s: spilt)
{
system.debug('***********'+s);

}

 Its  Not spiltting,

 

 Bur same code  when run in  console it will  work

 

String address='Abbyville,null,Kansas,92274&#124;1520 Malley Road,Anchorage,Alaska,99501&#124;';
string[] spilt= address.split(';');
for(string s: spilt)
{
system.debug('***********'+s);
}

 can any one help y it is not spiltting

 

Thanks

Nageswar

 

 

Hi alll,

  I Have witten test Calss  for apex class It covers 71%,

 

@isTest
private class TestAIOlineitems
{
static TestMethod void testAI01Line()
{
AIOlineitems.wrappo w=new AIOlineitems.wrappo();
Products__c p=new Products__c(name='xxxxx');
insert p;
Purchase_Order__c po=new Purchase_Order__c();
insert po;
Availability_In_Order__c ava =new Availability_In_Order__c(Purchase_Order__c=po.id);
insert ava;
Availability_In_Order_Lineitems__c ao=new Availability_In_Order_Lineitems__c(Availability_In_Order__c=ava.id,Products__c=p.id);
insert ao;
ApexPages.Currentpage().getParameters().put('id',ava.ID);

ApexPages.StandardController sc = new ApexPages.StandardController(ao);
AIOlineitems ai=new AIOlineitems(sc);
ai.Cancelpoedit();
ai.getproducts1();
ai.newPoline();
ApexPages.Currentpage().getParameters().put('id',ao.ID);
ai.editprodu();
ai.savepoedit();
ai.deleteprodu();

}

----------------------------------------------

 The apex class is

-------------------------------------------------------------

public class AIOlineitems {
public boolean check{set;get;}
id pid;
public boolean Newpol{set;get;}
public Integer sno{set;get;}
public Id poedit{set;get;}
public Availability_In_Order_Lineitems__c newPO{set;get;}
public Id poid{set;get;}
public map<id,Availability_In_Order_Lineitems__c> polmap{set;get;}
public Id productname{set;get;}
public integer cou{set;get;}
public List<SelectOption> productlist{set;get;}
public Availability_In_Order_Lineitems__c edu{set;get;}
public list<wrappo> POlist{set;get;}
public class wrappo{
public Availability_In_Order_Lineitems__c pol{set;get;}
public boolean newp{set;get;}
public integer no{set;get;}
public wrappo(){
pol=new Availability_In_Order_Lineitems__c();
newp=false;
}
}
    public AIOlineitems(ApexPages.StandardController controller) {
    productlist=new List<SelectOption>();
     polmap=new map<id,Availability_In_Order_Lineitems__c>();
    for(products__c p:[select id,Name from products__c ORDER BY Name DESC limit 1000])
    productlist.add(new SelectOption(p.Id,p.Name));
NewPol=false;
PoId=Apexpages.currentpage().getParameters().get('id');
POlist=new list<wrappo>();
cou=0;
general();

    }
    public void Cancelpoedit(){
    edu=null;
    }
    public void general(){
    edu=null;
    if(polist.size()>0)
    polist.clear();
for(Availability_In_Order_Lineitems__c pol:[select Id,Name,Products__c,Products__r.name,Ordered_Quantity__c,Available_Quantity__c,Total_Product_price__c  from Availability_In_Order_Lineitems__c where Availability_In_Order__c=:poid ORDER BY Name DESC limit 1000])
{
wrappo w=new wrappo();
w.pol=pol;
w.newp=false;
w.no=cou+1;
cou=cou+1;
polmap.put(pol.id,pol);
polist.add(w);

}
for(Availability_In_Order__C a:[select id,Purchase_Order__c from Availability_In_Order__C where id=:poid])
pid=a.Purchase_Order__c;
Purchase_Order__c p1=[select id,Available_Order_Accepted_by_executive__c from Purchase_Order__c where id=:pid];
check=p1.Available_Order_Accepted_by_executive__c;
}
    public List<SelectOption> getproducts1(){
return productlist;
}
    Public void newPoline(){
   wrappo w=new wrappo();
   
    newpo=new Availability_In_Order_Lineitems__c();
    w.pol=newpo;
    w.newp=true;
    w.no=cou+1;
cou=cou+1;
    polist.add(w);
    }
    
    public void editprodu(){
     poedit=Apexpages.currentpage().getParameters().get('editid');
     edu=polmap.get(poedit);
     productname=edu.products__c;
    sno=Integer.valueof(Apexpages.currentpage().getParameters().get('sno'));
    }
public pagereference savepoedit(){
pagereference p;
if(edu!=null){
If(edu.products__c!=productname)
edu.products__c=productname;
update edu;
polist[sno-1].newp=false;
}
else{
polist[cou-1].pol.Availability_In_Order__c=poid;
polist[cou-1].pol.Products__c=productname;
insert polist[cou-1].pol;
polist[cou-1].newp=false;
}
general();
p=new pagereference('/'+poid);
return p;
}
public pagereference deleteprodu(){
pagereference p;
   poedit=Apexpages.currentpage().getParameters().get('deid');
     Availability_In_Order_Lineitems__c delpo=polmap.get(poedit);
     if(delpo!=null)
     delete delpo;
     //polist.clear();
     p=new pagereference('/'+poid);
    //general();
    return p;
}
}

 

 this code is not covering rajesh can help me to  cover that code

Hi all. 

  i need test coverage for apex class,  My apex, calss is

 

public class AIOlineitems {
public boolean check{set;get;}
id pid;
public boolean Newpol{set;get;}
public Integer sno{set;get;}
public Id poedit{set;get;}
public Availability_In_Order_Lineitems__c newPO{set;get;}
public Id poid{set;get;}
public map<id,Availability_In_Order_Lineitems__c> polmap{set;get;}
public Id productname{set;get;}
public integer cou{set;get;}
public List<SelectOption> productlist{set;get;}
public Availability_In_Order_Lineitems__c edu{set;get;}
public list<wrappo> POlist{set;get;}
public class wrappo{
public Availability_In_Order_Lineitems__c pol{set;get;}
public boolean newp{set;get;}
public integer no{set;get;}
public wrappo(){
pol=new Availability_In_Order_Lineitems__c();
newp=false;
}
}
    public AIOlineitems(ApexPages.StandardController controller) {
    productlist=new List<SelectOption>();
     polmap=new map<id,Availability_In_Order_Lineitems__c>();
    for(products__c p:[select id,Name from products__c ORDER BY Name DESC limit 1000])
    productlist.add(new SelectOption(p.Id,p.Name));
NewPol=false;
PoId=Apexpages.currentpage().getParameters().get('id');
POlist=new list<wrappo>();
cou=0;
general();

    }
    public void Cancelpoedit(){
    edu=null;
    }
    public void general(){
    edu=null;
    if(polist.size()>0)
    polist.clear();
for(Availability_In_Order_Lineitems__c pol:[select Id,Name,Products__c,Products__r.name,Ordered_Quantity__c,Available_Quantity__c,Total_Product_price__c  from Availability_In_Order_Lineitems__c where Availability_In_Order__c=:poid ORDER BY Name DESC limit 1000])
{
wrappo w=new wrappo();
w.pol=pol;
w.newp=false;
w.no=cou+1;
cou=cou+1;
polmap.put(pol.id,pol);
polist.add(w);

}
for(Availability_In_Order__C a:[select id,Purchase_Order__c from Availability_In_Order__C where id=:poid])
pid=a.Purchase_Order__c;
Purchase_Order__c p1=[select id,Available_Order_Accepted_by_executive__c from Purchase_Order__c where id=:pid];
check=p1.Available_Order_Accepted_by_executive__c;
}
    public List<SelectOption> getproducts1(){
return productlist;
}
    Public void newPoline(){
   wrappo w=new wrappo();
   
    newpo=new Availability_In_Order_Lineitems__c();
    w.pol=newpo;
    w.newp=true;
    w.no=cou+1;
cou=cou+1;
    polist.add(w);
    }
    
    public void editprodu(){
     poedit=Apexpages.currentpage().getParameters().get('editid');
     edu=polmap.get(poedit);
     productname=edu.products__c;
    sno=Integer.valueof(Apexpages.currentpage().getParameters().get('sno'));
    }
public pagereference savepoedit(){
pagereference p;
if(edu!=null){
If(edu.products__c!=productname)
edu.products__c=productname;
update edu;
polist[sno-1].newp=false;
}
else{
polist[cou-1].pol.Availability_In_Order__c=poid;
polist[cou-1].pol.Products__c=productname;
insert polist[cou-1].pol;
polist[cou-1].newp=false;
}
general();
p=new pagereference('/'+poid);
return p;
}
public pagereference deleteprodu(){
pagereference p;
   poedit=Apexpages.currentpage().getParameters().get('deid');
     Availability_In_Order_Lineitems__c delpo=polmap.get(poedit);
     if(delpo!=null)
     delete delpo;
     //polist.clear();
     p=new pagereference('/'+poid);
    //general();
    return p;
}
}

 

 i have   written test class for the apex calss bu t i m getting error like  Compile Error: Constructor not defined: [AIOlineitems].<Constructor>() at line 15 column 23

@isTest
private class TestAIOlineitems
{
static TestMethod void testAI01Line()
{
Products__c p=new Products__c(name='xxxxx');
insert p;
Purchase_Order__c po=new Purchase_Order__c();
insert po;
Availability_In_Order__c ava =new Availability_In_Order__c(Purchase_Order__c=po.id);
insert ava;
Availability_In_Order_Lineitems__c ao=new Availability_In_Order_Lineitems__c(Availability_In_Order__c=ava.id,Products__c=p.id);
insert ao;
ApexPages.Currentpage().getParameters().put('id',p.ID);
AIOlineitems ai=new AIOlineitems();
ai.getproducts1();
ai.Cancelpoedit();
ai.newPoline();
ai.editprodu();
ai.savepoedit();
ai.deleteprodu();

}
}


HI all,

     

 Hi need to test coverage  for the apex class ,I am getting 66%, can any one help  to get more that 75%, My apex class is

 

 

public class acceptavailability
{
id i;
id pid;
public acceptavailability()
{
i=apexpages.currentpage().getparameters().get('id');
system.debug('i===='+i);
for(Availability_In_Order__c a:[select id,Purchase_Order__c from Availability_In_Order__c where id=:i])
{
pid=a.Purchase_Order__c;
system.debug('+++'+pid);
}
}
public pagereference update1()
{
pagereference p2=new pagereference('/'+i);
purchase_order__C p=[select id,Available_Order_Accepted_by_executive__c from purchase_order__C where id=:pid];
system.debug('p===='+p.id);
p.Available_Order_Accepted_by_executive__c=true;
update p;
return p2;
}
}

 

_---------------------- 

My test class is

 

 

@isTest
Private class Testacceptavailability
{
static TestMethod void TestAccept()
{
id i ='a07U000000AK8mW';
id pid;
Purchase_Order__c p = new Purchase_Order__c();
insert p;

Availability_In_Order__c a= New Availability_In_Order__c(Purchase_Order__c=p.id );
insert a;

acceptavailability ac= new acceptavailability();
ac.update1();

}

}

  The red lines are not covered any can help


HI all

  I hava On e XML File , Now i Want Get the value of particular Tag   from that XMl,  Suppose MY  XML file 

 is 

 

<GeocodeResponse>
<status>OK</status>
<result>
<type>locality</type>
<type>political</type>
<formatted_address>Hyderabad, Andhra Pradesh, India</formatted_address>
<address_component>
<long_name>Hyderabad</long_name>
<short_name>Hyderabad</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Ranga Reddy</long_name>
<short_name>R.R. District</short_name>
<type>administrative_area_level_2</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Andhra Pradesh</long_name>
<short_name>Andhra Pradesh</short_name>
<type>administrative_area_level_1</type>
<type>political</type>
</address_component>
<address_component>
<long_name>India</long_name>
<short_name>IN</short_name>
<type>country</type>
<type>political</type>
</address_component>
<geometry>
<location>
<lat>17.3850440</lat>
<lng>78.4866710</lng>
</location>
<location_type>APPROXIMATE</location_type>
<viewport>
<southwest>
<lat>17.2145925</lat>
<lng>78.2305522</lng>
</southwest>
<northeast>
<lat>17.5553369</lat>
<lng>78.7427898</lng>
</northeast>
</viewport>
<bounds>
<southwest>
<lat>17.2383708</lat>
<lng>78.2401411</lng>
</southwest>
<northeast>
<lat>17.5794481</lat>
<lng>78.6913581</lng>
</northeast>
</bounds>
</geometry>
</result>
</GeocodeResponse>
 I want  that  coloured Location value , Any body can  help me 
 Thanks 
 Nageswar

Hi All,

 

 I have  Asingto field in event object , it  is related to user and calender objects, 

 

  Field Label is AsignTo , Filed Name is Owner,   Now I want the  Asignto   field ApI Name.

 

   Field Label  Field Name

 Asingto           Owner(user,calender)

 

 

Thanks All.

HI All,

 

  I  have written trigger  on School_del__c, that  will be updated phone number filed in acoount. but Now  I am  creating   a record in School_del__c  i am getting errormeassage like   

 

""Apex trigger UpdatephoneNumber caused an unexpected exception, contact your administrator: UpdatephoneNumber: execution of AfterInsert caused by: System.StringException: Invalid id: 467894: Trigger.UpdatephoneNumber: line 6, column 1"

 

 the  trigger code is

 

 

 

 

trigger UpdatephoneNumber on School_del__c (after insert ,after update) {

set<id> ss=new set<id>();
for(School_del__c sc:trigger.new) {
if(sc.PhoneNumber__c == null || sc.PhoneNumber__c != null) {
ss.add(sc.PhoneNumber__c );
}
}

map<id, Account> app=new map<id, Account>();
List<Account> accountsToUpdate = new List<Account>();

for(account a:[select id,phone from account where id in:ss limit 50000])
app.put(a.id, a);

for(School_del__c sc:trigger.new) {
if(sc.PhoneNumber__c == null ||sc.PhoneNumber__c != null) {
Account acc = app.get(sc.PhoneNumber__c );
acc.phone = sc.PhoneNumber__c;
accountsToUpdate.add(acc);
}
}

if(!accountsToUpdate.isEmpty()) {
update accountsToUpdate;
}
}

 

  any one can help to solve this error

 

 

Thanks

Nageswara Reddy.

Hi all,

         which formula or workflow suitable  for every two days sent the mail automatically eg: 29/5/2012(dd/mm/yy) after

two day 31/5/2012 then after 2 days 2/6/2012.....................