• rajesh_y
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 21
    Replies

Hi,

I am new to programming can any one help me please.i want to retrive data from database and display in VF pageblock table.

  • March 16, 2011
  • Like
  • 0

Hi ,

In the following code i had written test coverage for this class but its not covered could you please suggest whats wrong in my code....
when i call some methods from test coverage those will not be invoked please help me  thanks in advance...
public class newpatient {
public string address1{set;get;}
public string address2{set;get;}
public string distance{set;get;}
public boolean selection{set;get;}
public string lastname{set;get;}
public id userid=userinfo.getuserid();
public string sample{set;get;}
 Patient__c patient=new Patient__c();
    public newpatient(ApexPages.StandardController controller)
     {
    patient = (Patient__c)controller.getRecord();
   //address2=patient.E_Address1__c+','+patient.City__c+','+patient.County__c; 
    selection=false;
    lastname='';
    selectall();
    }
    Navigator__c pat=new Navigator__c();
    public Navigator__c getpat()
    {
    return pat;
    }
    public void setPat(navigator__c pat)
    {
    pat=pat;
    }
   
    public patient__c getpatient()
    {
    return patient;
    }
    public Pagereference saverec()
    {
    string str=valueone+valuethree;
    if(str!=null)
    {
     //navigator__c navigator=[select id from navigator__c where fullname__c=:str and createdbyid=:userid limit 1];
     //patient.Assigned_Navigator__c=mapval.get(str);
    }
    //patient.distance__c=valuetwo;
    
    insert patient;
    pagereference p=new pagereference('/'+patient.id);
    return p;
    }
     Navigator__c n=new Navigator__c();    
    public void change()
    {
    selection=true;
    if(patient.Assigned_Navigator__c!=null)
    n=[select id,E_Address_1__c,City__c,states__C from Navigator__c where id=:patient.Assigned_Navigator__c];
    address1=n.E_Address_1__c+','+n.City__c+','+n.states__C;
    address2=patient.E_Address1__c+','+patient.City__c+','+patient.states__c+','+patient.Zip__c; 
    system.debug('address1'+address1+'Address2'+address2);
    
    //selectall();
     
    
    }
   public class wraperclass
   {
   public id id{set;get;}
   public string address{set;get;}
   public string E_Address1{set;get;}
   public string City{set;get;}
   public string country{set;get;}
   public boolean check{set;get;}
   public string addr{set;get;}
   public string cancertype{set;get;}
   public string fname{set;get;}
   public string lname{set;get;}
  }
   list<wraperclass> navilist=new list<wraperclass>();
   public string address{set;get;} 
   list<string> slist=new list<string>();
   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(pat.Type_of_Cancer__c!=null && pat.Gender__c!=null&&Lastname=='')
 {
 //cancer type and Gender
  for(Navigator__c nv:[select fullname__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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,name,E_Navigator_Last_Name__c ,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Type_of_Cancer__c=:patient.Cancer_Type__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;
   address22=address22+nv.id+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; 
    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 void Coordinates(string add1 ,string add2)
{
  string url='http://maps.googleapis.com/maps/api/distancematrix/xml?origins='+add1+'&destinations='+add2+'&mode=driving&language=en&sensor=false';
   //string url='http://maps.googleapis.com/maps/api/distancematrix/xml?origins=hyderabad&destinations=banglore|kurnool|delhi&mode=driving&language=en&sensor=false';
    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();
string[] Coordinates = responseBody.split(',',0);
  XmlStreamReader reader = res.getXmlStreamReader();*/
   XmlStreamReader reader;
            if(!isApexTest)
              { 
                 HttpResponse res = h.send(req);
                 String responseBody = res.getBody();
                 reader= res.getXmlStreamReader();
                 
               }
               else
               {
                string body='<text>4455</text>';
                reader=new XmlStreamReader(body);
                
               }
  readXMLResponse(reader); 
 
} 
public String mainForTest(){
        isApexTest = true;
        return '';
    }
   public String readXMLResponse(XmlStreamReader reader)
  {
     wlist=new list<navclass>();
     string retValue; // Read through the XML
     integer i=0;
     while(reader.hasNext())
    {
  
    if (reader.getEventType() == XmlTag.START_ELEMENT)
    {
      
      
      if (reader.getLocalName()=='text') 
      {
      
          reader.next();
        if (reader.getEventType()==XmlTag.characters)
       {
          retValue= reader.getText();
          system.debug('*********'+retvalue);
            navclass w=new navclass();
            //w.distanceval=1;
          if(retvalue.substring(retvalue.length()-2,retvalue.length())=='km')
          {
           sample=string.valueof(retvalue);
         
           retValue=retValue.replace(',','');
           integer value=integer.valueof(retValue.substring(0,retValue.length()-3)); 
           w.distanceval=value*0.62; 
            
           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();
      
 }
 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 decimal 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;}
}
  /*  
public static testMethod void mytest()
{
navigator__c n=new navigator__c(name='aaa',states__C='lowa',Date_of_Entry__c=system.today(),E_Navigator_Last_Name__c='lab',Zip_Code__c='5688876552',Ethnic_Racial__c='Asian',Date_of_Birth__c=system.today(),Last_name__c='l',Type_of_Cancer__c='**bleep** Cancer',Gender__C='male',Been_Through_Orientation__c=true);

insert n;
patient__c p=new patient__c (E_Electronic_Chart_ID__c='aa1',E_LastName__c='abc',Cancer_Type__c='**bleep** Cancer');
//insert p;
ApexPages.StandardController sc = new ApexPages.standardController(p);
newpatient np=new newpatient(sc); 
String retVal =np.mainForTest();

wraperclass w=new wraperclass();
test.starttest();

np.finding();
np.filtering();
test.stoptest();
}
public static testMethod void mytest2()
{
navigator__c n=new navigator__c(name='aaa',states__C='lowa',Date_of_Entry__c=system.today(),E_Navigator_Last_Name__c='lab',Zip_Code__c='5688876552',Ethnic_Racial__c='Asian',Date_of_Birth__c=system.today(),Last_name__c='l',Type_of_Cancer__c='**bleep** Cancer',Gender__C='male',Been_Through_Orientation__c=true);

insert n;
patient__c p=new patient__c ();
//insert p;
ApexPages.StandardController sc = new ApexPages.standardController(p);
newpatient np=new newpatient(sc); 
String retVal =np.mainForTest();

wraperclass w=new wraperclass();
System.test.starttest();

//np.mainForTest();
np.filtering();
system.test.stoptest();
}*/

private static testMethod void mytest()
{
      navigator__c n=new navigator__c(name='aaa',states__C='lowa',Date_of_Entry__c=system.today(),E_Navigator_Last_Name__c='lab',Zip_Code__c='5688876552',Ethnic_Racial__c='Asian',Date_of_Birth__c=system.today(),Last_name__c='l',Type_of_Cancer__c='**bleep** Cancer',Gender__C='male',Been_Through_Orientation__c=true);
      insert n;
      patient__c p=new patient__c (E_Electronic_Chart_ID__c='aa1',E_LastName__c='abc');

      ApexPages.StandardController sc = new ApexPages.standardController(p);
      newpatient np=new newpatient(sc); 
      
      newpatient np1=new newpatient (sc); 
      newpatient np2=new newpatient (sc);
      newpatient np3=new newpatient (sc);
      newpatient np4=new newpatient (sc);
      newpatient np5=new newpatient (sc);
      wraperclass w=new wraperclass();

    w.id=n.id;
    w.E_Address1=n.E_Address_1__c;
    w.City=n.city__c;
   // w.country=n.County__c;
    w.address=n.name+';'+n.E_Address_1__c+','+n.city__c+','+n.states__C+';'+n.Type_of_Cancer__c;
    np.address=w.address;
    np.navilist.add(w);
    np.lastname='l';
    np.valueOne='aaa';
    np.patient.Cancer_Type__c='**bleep** Cancer';
        PageReference pageRef = Page.newpatient; 
        Test.setCurrentPage(pageRef); 
        ApexPages.currentPage().getParameters().put('one','aaa'); 
    np.patient.E_Electronic_Chart_ID__c='aab';
    np.patient.E_LastName__c='aac';
    np.pat.Type_of_Cancer__c='**bleep** Cancer';
    np1.pat.Type_of_Cancer__c='**bleep** Cancer';
    np1.lastname='l';
    np1.pat.Gender__C='male';
       np2.pat.Gender__C='male';
       np3.lastname='l';
       np4.pat.Gender__C='male';
       np4.lastname='l';
       np5.pat.Type_of_Cancer__c='**bleep** Cancer';
       test.starttest();
     
     np.getpatient();
     
     np.change();
     np.getnavilist();
     np.selectall();
     np.finding();
     np.filtering();
     np1.filtering();
     np2.filtering();
     np3.filtering();
     np4.filtering();
     np5.filtering();
     np.saverec();
     np.setpat(n);
     np.getpat();
     test.stoptest();
}

 

}

Hi  I i am getting following error when try to update bulk of records  from system log

Too many SOQL queries: 101

trigger updatetrigg on Lead_Categories__c (before update)
{
list<Related_Team_Member__c > rtmlist=new list<Related_Team_Member__c >();

list<Related_Team_Member__c > tlist=new list<Related_Team_Member__c >();
list<teammember__c> teamlist=new list<teammember__c>();
list<teammember__C> tmlist=new list<teammember__C>();
for(Lead_Categories__c o:trigger.old)
{
for(Lead_Categories__c l:trigger.new)
{
teamlist=[select Access_Category__c,Access_Item__c,Access_Level__c from teammember__c where Access_Level__c=:l.Access_Level__c and  Access_Item__c=:l.Access_Item__c and Access_Category__c=:l.Access_Category__c limit 1];

if(o.accepted__c==false)
{
if(l.accepted__c==true && l.type__c=='Add')
{
//list<teammember__c> tlist1=[select Access_Category__c,Access_Item__c,Access_Level__c from teammember__c where Access_Level__c=:l.Access_Level__c and  Access_Item__c=:l.Access_Item__c and Access_Category__c=:l.Access_Category__c limit 1];

/*for(teammember__c team:tlist1)
{
teamlist.add(team);
}*/
if(teamlist.size()>0)
{
for(teammember__c team:teamlist)
{
Related_Team_Member__c rtm1=new Related_Team_Member__c(); 
rtm1.team__C=l.team__C;
rtm1.teammember__C=team.id;
l.teammember__c=team.id;

rtmlist.add(rtm1);
}
}
else
{
teammember__c t=new teammember__c();
t.Access_Category__c=l.Access_Category__c;
t.name=t.id;
t.Access_Item__c=l.Access_Item__c;
t.Access_Level__c=l.Access_Level__c;
t.team__c=l.team__c;
//insert t;
tmlist.add(t);
l.teammember__c=t.id;


}
}
if(l.accepted__c==true && l.type__c=='Remove')
{
for(Related_Team_Member__c tt:[select id from Related_Team_Member__c where teammember__c=:l.teammember__C and team__c=:l.team__C])
{
tlist.add(tt);

}
}
}
}
}
if(tlist.size()>0)
delete tlist;
if(tmlist.size()>0)
insert tmlist;
if(rtmlist.size()>0)
insert rtmlist;
}

 Whats wrong in my please let me know

 

 

thank you in advance

 

 



Hi 

I need a clarification on chatter plus .
I would like to see all chatter plus (account users) in lookup  field which held in custom object or standard object.Is it possible ? if possible then How?
Please Help Me In This Area.
thank you in advance
rajesh
 
public class constantcontact 
{
public void conlist()
{
Http h = new Http();
    HttpRequest req = new HttpRequest();
  final string username = '54149b86-22eb-496b-a326-132dfa9f3786%rajesh_y'; 
        final string password = 'Dskvap123';
        Blob headerValue = Blob.valueOf(username);
     String authorizationHeader = 'BASIC ' +EncodingUtil.base64Encode(headerValue);
     //String authorizationHeader =username+':'+password;
     req.setHeader('Authorization',authorizationHeader);
      //req.setHeader('Content-length', '1753' );
     req.setHeader('Host','https://api.constantcontact.com/ws/customers//contacts/1');
    req.setHeader('Connection','keep-alive');
    req.setHeader('Content-Type', 'application/atom+xml');
     req.setMethod('GET');
      req.setbody('https://api.constantcontact.com/ws/customers/rajesh_y/contacts');
      req.setEndpoint('http://api.constantcontact.com/ws/customers/joesflowers/lists');
      HttpResponse res = h.send(req);
      system.debug('********'+res.getbody());

}
}

 This code for getting all contacts from constantcontact  to salesforce through http callouts

 

But i am getting error like 

An Authentication object was not found in the SecurityContext

Status=Unauthorized, StatusCode=401

 

All credential are valid 

whats problem in my code please help me

 

 

thank you in advance

 

rajesh

Hi All I wanna get all contacts from constant contact to salesforce the code is public class constantcontact  { public void conlist() { Http h = new Http();     HttpRequest req = new HttpRequest();   final string username = '54149b86-22eb-496b-a326-132dfa9f3786%rajesh_y';          final string password = 'Dskvap123';         Blob headerValue = Blob.valueOf(username);      String authorizationHeader = 'BASIC ' +EncodingUtil.base64Encode(headerValue);      //String authorizationHeader =username+':'+password;      req.setHeader('Authorization',authorizationHeader);       //req.setHeader('Content-length', '1753' );      req.setHeader('Host','https://api.constantcontact.com/ws/customers//contacts/1');     req.setHeader('Connection','keep-alive');     req.setHeader('Content-Type', 'application/atom+xml');      req.setMethod('GET');       req.setbody('https://api.constantcontact.com/ws/customers/rajesh_y/contacts');       req.setEndpoint('http://api.constantcontact.com/ws/customers/joesflowers/lists');       HttpResponse res = h.send(req);       system.debug('********'+res.getbody());  } }  but i am getting error like. Unauthorized StatusCode=401   whats wrong in the code  All credentials are valid please help me in this area   thank you in advace.  
 
public class constantcontact 
{
public void conlist()
{
Http h = new Http();
    HttpRequest req = new HttpRequest();
  final string username = '54149b86-22eb-496b-a326-132dfa9f3786%rajesh_y'; 
        final string password = 'Dskvap123';
        Blob headerValue = Blob.valueOf(username);
     String authorizationHeader = 'BASIC ' +EncodingUtil.base64Encode(headerValue);
     //String authorizationHeader =username+':'+password;
     req.setHeader('Authorization',authorizationHeader);
      //req.setHeader('Content-length', '1753' );
     req.setHeader('Host','https://api.constantcontact.com/ws/customers//contacts/1');
    req.setHeader('Connection','keep-alive');
    req.setHeader('Content-Type', 'application/atom+xml');
     req.setMethod('GET');
      req.setbody('https://api.constantcontact.com/ws/customers/rajesh_y/contacts');
      req.setEndpoint('http://api.constantcontact.com/ws/customers/joesflowers/lists');
      HttpResponse res = h.send(req);
      system.debug('********'+res.getbody());

}
}

 Please help me 

 

thank you in advance

 

 

Hi ALL

           How can i integrate salesforce with my sql without apps(app exchange).I would like to implement it using apex call outs.Is it possible.?. I didnot find any apis for mysql.
I wanna transfer data between salesforce and mysql.Is there any to connect salesforce to mysql through coding(apex coding only) or any apis for this (mysql).And how to connect to like this local urlhttp://localhost/phpmyadmin from salesforce 
Please help me 
thank you in advance.
rajesh

Hi All

 

This is my code

public class pay
 {
 public void transefer()
{
 Http h = new Http();
 HttpRequest req = new HttpRequest();
 //String url1 = 'https://api-3t.sandbox.paypal.com/2.0/';
 
 String url='https://svcs.sandbox.paypal.com/AdaptivePayments/Pay ';
 string un='radhik_1310032695_biz_api1.dskvap.com';
 //string un='radhik_1311331870_per@dskvap.com';
 //string pw='311331850';
 string pw='1310032746';
   string sig ='ALIeMNX23qxDxiFSuqGvrVD7fZmrAiLQwRfHOZzphVWLml57Bz8XsGA5';

 string body='<?xml version="1.0" encoding="utf-8" ?>';
body+='<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">';
 body+='<SOAP-ENV:Header><RequesterCredentials xmlns="urn:ebay:api:PayPalAPI">';
body+='<Credentials xmlns="urn:ebay:apis:eBLBaseComponents">';
body+='<Username>'+un+'</Username><Password>'+pw+'</Password><Signature>'+sig+'</Signature>';
body+='</Credentials></RequesterCredentials></SOAP-ENV:Header>';
body+='<SOAP-ENV:Body><PayRequest xmlns="http://svcs.paypal.com/types/ap">';
 body+='<actionType xmlns="">PAY</actionType>';
 body+='<requestEnvelope xmlns=""><errorLanguage>en_US</errorLanguage></requestEnvelope>';
 body+='<cancelUrl xmlns="">http://www.xchaos.co.uk</cancelUrl>';
body+='<currencyCode xmlns="">USD</currencyCode><feesPayer xmlns="">EACHRECEIVER</feesPayer>';
 body+='<receiverList xmlns=""> <receiver><amount>100</amount><email>radhik_1311331396_biz@dskvap.com</email></receiver></receiverList>';
 body+='<clientDetails><ipAddress>183.82.96.26</ipAddress><applicationId>APP-80W284485P519543T</applicationId></clientDetails>';
  body+=' <ipnNotificationUrl>http://www.xchaos.co.uk</ipnNotificationUrl>';
     // body+='<trackingId>1234</trackingId>';
 
      body+='<returnUrl xmlns="">http://www.xchaos.co.uk</returnUrl>';
    body+='</PayRequest>';
    
  body+='</SOAP-ENV:Body>';
  
body+='</SOAP-ENV:Envelope>';
 
   req.setBody(body);
  req.setEndpoint(url);
  //req.setEndpoint(url1);
  req.setMethod('POST');
  req.setHeader('Content-length', '1753' );
  req.setHeader('Content-Type', 'text/xml;charset=UTF-8'); 
  req.setHeader('SOAPAction','');
  req.setHeader('Host','api-aa.sandbox.paypal.com');
  HttpResponse res =h.send(req);
  String xml = res.getBody();
  system.debug('----------'+res.getbody());
   
}
 
}

 i am getting errors like wuthorization failed invalid username and password,even i gave valid credentials

 

 

thank you in advance

rajesh

Hi All 

 

 

this is my code 

public class pay
 {
 public void transefer()
{
 Http h = new Http();
 HttpRequest req = new HttpRequest();
 //String url1 = 'https://api-3t.sandbox.paypal.com/2.0/';
 
 String url='https://svcs.sandbox.paypal.com/AdaptivePayments/Pay ';
 string un='radhik_1310032695_biz_api1.dskvap.com';
 //string un='radhik_1311331870_per@dskvap.com';
 //string pw='311331850';
 string pw='1310032746';
   string sig ='ALIeMNX23qxDxiFSuqGvrVD7fZmrAiLQwRfHOZzphVWLml57Bz8XsGA5';

 string body='<?xml version="1.0" encoding="utf-8" ?>';
body+='<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">';
 body+='<SOAP-ENV:Header><RequesterCredentials xmlns="urn:ebay:api:PayPalAPI">';
body+='<Credentials xmlns="urn:ebay:apis:eBLBaseComponents">';
body+='<Username>'+un+'</Username><Password>'+pw+'</Password><Signature>'+sig+'</Signature>';
body+='</Credentials></RequesterCredentials></SOAP-ENV:Header>';
body+='<SOAP-ENV:Body><PayRequest xmlns="http://svcs.paypal.com/types/ap">';
 body+='<actionType xmlns="">PAY</actionType>';
 body+='<requestEnvelope xmlns=""><errorLanguage>en_US</errorLanguage></requestEnvelope>';
 body+='<cancelUrl xmlns="">http://www.xchaos.co.uk</cancelUrl>';
body+='<currencyCode xmlns="">USD</currencyCode><feesPayer xmlns="">EACHRECEIVER</feesPayer>';
 body+='<receiverList xmlns=""> <receiver><amount>100</amount><email>radhik_1311331396_biz@dskvap.com</email></receiver></receiverList>';
 body+='<clientDetails><ipAddress>183.82.96.26</ipAddress><applicationId>APP-80W284485P519543T</applicationId></clientDetails>';
  body+=' <ipnNotificationUrl>http://www.xchaos.co.uk</ipnNotificationUrl>';
     // body+='<trackingId>1234</trackingId>';
 
      body+='<returnUrl xmlns="">http://www.xchaos.co.uk</returnUrl>';
    body+='</PayRequest>';
    
  body+='</SOAP-ENV:Body>';
  
body+='</SOAP-ENV:Envelope>';
 
   req.setBody(body);
  req.setEndpoint(url);
  //req.setEndpoint(url1);
  req.setMethod('POST');
  req.setHeader('Content-length', '1753' );
  req.setHeader('Content-Type', 'text/xml;charset=UTF-8'); 
  req.setHeader('SOAPAction','');
  req.setHeader('Host','api-aa.sandbox.paypal.com');
  HttpResponse res =h.send(req);
  String xml = res.getBody();
  system.debug('----------'+res.getbody());
   
}
 
}

 But am getting error authorization failed username and password invalid.

 

whats the problem in my code.

 

thank you in advance.

 

Hi All

 

How to Generate multiple worksheets in single excel file from visualforce page.

Is it possible ?.

If Possible please help me with detail.

 

thank you in advance

rajesh

 

Hi am using following code in  salesforce
to integrate with campaign monitor.
but i am getting errors like
12:47:38.666 (666977000)|CALLOUT_RESPONSE|[51]|System.HttpResponse[Status=Bad Request, StatusCode=400]

12:47:38.667 (667346000)|USER_DEBUG|[55]|DEBUG|********<?xml version="1.0" encoding="utf-8"?><Result><Code>400</Code><Message>Failed to deserialize your request.
Please check the documentation and try again.
Fields in error: client</Message></Result>


Please solve my problem.


public class lll {

public string errormessage;



 public  void Login()
    { 
     Http h = new Http();
        HttpRequest req = new HttpRequest();
        //ErrorMessage='';
       final string baseUrl = 'http://dskvapconsultancyservices.createsend.com/'; 
        final string username = '05b88f78dfc4f00ce93553a79be93d04'; 
        final string password = 'rajesh12';
       
  string apikey='05b88f78dfc4f00ce93553a79be93d04';
     Blob headerValue = Blob.valueOf(username + ':' + password);
     String authorizationHeader = 'BASIC ' +
     EncodingUtil.base64Encode(headerValue);
     req.setHeader('Host','http://api.createsend.com');
    req.setHeader('Content-length', '1753' );
    req.setHeader('Content-Type', 'text/xml;charset=UTF-8');
    req.setHeader('Authorization',authorizationHeader);
    //req.setHeader('Authorization','Basic 05b88f78dfc4f00ce93553a79be93d04==');
  //req.setHeader('content-type', 'text/xml;charset=utf-8');
  //req.setHeader('Content-Length','1024');
  //req.setHeader('Host','http://dskvapconsultancyservices.createsend.com/');
  //req.setHeader('Connection','keep-alive');
     string body1='<?xml version="1.0" encoding="utf-8"?>';
      body1+='<Clients> ';
      /*body1+='<ApiKey>05b88f78dfc4f00ce93553a79be93d04</ApiKey>';
      body1+='<AccessDetails>';
          body1+='<Username>05b88f78dfc4f00ce93553a79be93d04</Username>';
          body1+='<AccessLevel>23</AccessLevel>';
          body1+='</AccessDetails>';*/
          body1+='<Client>';
          body1+='<ClientID></ClientID>';
          body1+='<Name></Name>';
          body1+='</Client>';
         body1+='</Clients>';   
        
        req.setMethod('GET');
        req.setBody(body1);

        //req.setEndpoint(baseUrl + '?loginType=&un='+username+'&pw='+password);
       //req.setEndpoint('http://api.createsend.com/05b88f78dfc4f00ce93553a79be93d04/v3/clients/clients.xml');
        req.setEndPoint('http://api.createsend.com/api/v3/clients.xml');
        //req.setbody('http://api.createsend.com/api/v3/clients.xml');
    
        
        HttpResponse res = h.send(req);
         //req.setEndpoint(baseUrl + 'apex/UploadFile_DifferentOrg');
           
          //res = h.send(req);
           system.debug('********'+res.getbody());
           if (res.getBody().indexOf('success=true')>-1)
           {
              system.debug('Success');
           }  
        }
        
        public void detail()
        {
        
        }
        
        
}

 thank you in advance

rajesh

public class lll {
public string errormessage;
@future (callout=true)
 public static void Login()
    {
        
        //ErrorMessage='';
       final string baseUrl = 'http://dskvapconsultancyservices.createsend.com/'; 
        final string username = '05b88f78dfc4f00ce93553a79be93d04'; 
        final string password = 'rajesh12';
       
  string apikey='05b88f78dfc4f00ce93553a79be93d04';
     Blob headerValue = Blob.valueOf(username + ':' + password);
     String authorizationHeader = 'BASIC ' +
     EncodingUtil.base64Encode(headerValue);
     //req.setHeader('Host','http://api.createsend.com');
  //req.setHeader('Content-length', '1753' );
 // req.setHeader('Content-Type', 'text/xml;charset=UTF-8');
    //req.setHeader('Authorization',authorizationHeader);
  //req.setHeader('content-type', 'text/xml;charset=utf-8');
  //req.setHeader('Content-Length','1024');
  //req.setHeader('Host','http://dskvapconsultancyservices.createsend.com/');
  //req.setHeader('Connection','keep-alive');
     string body1='<?xml version="1.0" encoding="utf-8"?>';
      body1+='<Clients> ';
      body1+='<ApiKey>05b88f78dfc4f00ce93553a79be93d04</ApiKey>';
      /*body1+='<AccessDetails>';
          body1+='<Username>05b88f78dfc4f00ce93553a79be93d04</Username>';
          body1+='<AccessLevel>23</AccessLevel>';
          body1+='</AccessDetails>';
          body1+='<CompanyName>My Company</CompanyName>';
          body1+='<ContactName>John</ContactName>';
          body1+='<EmailAddress>john@example.com</EmailAddress>';
          body1+='<Country>Australia</Country>';
          body1+='<TimeZone>(GMT+10:00) Canberra, Melbourne, Sydney</TimeZone>';*/
         body1+='</Clients>';   
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setMethod('GET');
        req.setBody(body1);

        //req.setEndpoint(baseUrl + '?loginType=&un='+username+'&pw='+password);
       //req.setEndpoint('http://api.createsend.com/05b88f78dfc4f00ce93553a79be93d04/v3/clients/clients.xml');
        req.setEndPoint('http://api.createsend.com/api/v3/clients.xml');
        //req.setbody('http://api.createsend.com/api/v3/clients.xml');
    
        
        HttpResponse res = h.send(req);
         //req.setEndpoint(baseUrl + 'apex/UploadFile_DifferentOrg');
           
          //res = h.send(req);
           system.debug('********'+res.getbody());
           if (res.getBody().indexOf('success=true')>-1)
           {
              system.debug('Success');
           }  
        }
}

 Hi i am trying the above code to get details of clients which are in campaign monitor 

 

but i am getting following error

 

 

10:55:01.657 (657169000)|USER_DEBUG|[52]|DEBUG|********<?xml version="1.0" encoding="utf-8"?><Result><Code>50</Code><Message>Must supply a valid HTTP Basic Authorization header</Message></Result>

 

|[48]|System.HttpResponse[Status=Unauthorized, StatusCode=401]

 

 

 

 

what should i do get output by using by using above code

 

 

can you please give the details regarding this 

 

please help me with modify the above code if possible.

 

thank you in advance..


HI All

   Can we integrate salesforce to other(campaing monitor,paypal,megento like ...) by using http callouts ?.

if any body have experiance with this please give me the details

 

 

thank you

rajesh

 

 

 
 
public class lll {
public string errormessage;
 public void Login()
    {
        
        ErrorMessage='';
       final string baseUrl = 'http://dskvapconsultancyservices.createsend.com/'; 
        final string username = '05b88f78dfc4f00ce93553a79be93d04'; 
        final string password = 'rajesh12';
       
  string apikey='05b88f78dfc4f00ce93553a79be93d04';
     Blob headerValue = Blob.valueOf(username + ':' + password);
     String authorizationHeader = 'BASIC ' +
     EncodingUtil.base64Encode(headerValue);
     req.setHeader('Host','http://dskvapconsultancyservices.createsend.com/');

    req.setHeader('Authorization',authorizationHeader);
  //req.setHeader('content-type', 'text/xml;charset=utf-8');
  //req.setHeader('Content-Length','1024');
  //req.setHeader('Host','http://dskvapconsultancyservices.createsend.com/');
  //req.setHeader('Connection','keep-alive');
        
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setMethod('GET');
        //req.setEndpoint(baseUrl + '?loginType=&un='+username+'&pw='+password);
       //req.setEndpoint('http://api.createsend.com/05b88f78dfc4f00ce93553a79be93d04/v3/clients/clients.xml');
        req.setEndPoint('http://api.createsend.com/api/v3/clients.xml?='+apikey);
        //req.setbody('http://api.createsend.com/api/v3/clients.xml');
    
        
        HttpResponse res = h.send(req);
         //req.setEndpoint(baseUrl + 'apex/UploadFile_DifferentOrg');
           
           res = h.send(req);
           system.debug('********'+res.getbody());
           if (res.getBody().indexOf('success=true')>-1)
           {
              system.debug('Success');
           }  
        }
}

 HI I am using this code to connect campaign monitor 

bit i am getting error  that null pointer defference

please let me know the actual way to headers and endpoint and body 

please expain how to set and what to set in headers for basic authorization

 

 

 

thank you in advance


 

 

Hi All 

If i enter products name on searchtextbox then the related products has to display in search textbox only.

Example 

when i enter R

then  ramesh,rajesh,ram has to appear in search text box which product names  starts whith R.

like Google functionality in vf page

 

 

please help me in this area 

 

thank you in advance

Hi All 

If i enter products name on searchtextbox then the related products has to display in search textbox only.

Example 

when i enter R

then  ramesh,rajesh,ram has to appear in search text box which product names  starts whith R.

like Google functionality in vf page

 

 

please help me in this area 

 

thank you in advance

 

 

Hi All

I three custom objects those are Community_Member__c,question__c.answer__c

 when i tried the following query

Community_Member__c c=[select name,(select header__c from question__r ) from Community_Member__c ];

its giving following error

Compile Error: line 1, column 23: Didn't understand relationship 'question__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

here paren is Community_Member__c 

child is question__c

 

 

please help why i am getting error

 

 

 

thank you in advance

 

 

rajesh

Hi All

I three custom objects those are Community_Member__c,question__c.answer__c

 when i tried the following query

Community_Member__c c=[select name,(select header__c from question__r ) from Community_Member__c ];

its giving following error

Compile Error: line 1, column 23: Didn't understand relationship 'question__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

here paren is Community_Member__c 

child is question__c

 

 

please help why i am getting error

 

 

 

thank you in advance

 

 

rajesh

hi all

i wanna get current customerportal id 

how its possible

help me plz

 

thanks in advance

 

 

hi

i wanna recieve mails from different domains(like gmail,yahoo,etc) to my site(which i have created in salesforce).

like inbound messages in salesforce

 

is there that chance

can i reciecve mails to my site

please help me with detail explanation

 

 

thank you in advance

 

global class remoteTest1 {  

    

     @RemoteAction 

     global static Contact[] findContacts(string Name) {  

        Name = '%'+Name+'%';  

         Contact[] c = [SELECT ID, Name, Phone, Email from Contact where NAME LIKE :Name ];      
             return c;  

    }  

    

 }

 

 

 this is the code for remoting 

in that i am not getting values of account 

please help me

 

Hi ,

In the following code i had written test coverage for this class but its not covered could you please suggest whats wrong in my code....
when i call some methods from test coverage those will not be invoked please help me  thanks in advance...
public class newpatient {
public string address1{set;get;}
public string address2{set;get;}
public string distance{set;get;}
public boolean selection{set;get;}
public string lastname{set;get;}
public id userid=userinfo.getuserid();
public string sample{set;get;}
 Patient__c patient=new Patient__c();
    public newpatient(ApexPages.StandardController controller)
     {
    patient = (Patient__c)controller.getRecord();
   //address2=patient.E_Address1__c+','+patient.City__c+','+patient.County__c; 
    selection=false;
    lastname='';
    selectall();
    }
    Navigator__c pat=new Navigator__c();
    public Navigator__c getpat()
    {
    return pat;
    }
    public void setPat(navigator__c pat)
    {
    pat=pat;
    }
   
    public patient__c getpatient()
    {
    return patient;
    }
    public Pagereference saverec()
    {
    string str=valueone+valuethree;
    if(str!=null)
    {
     //navigator__c navigator=[select id from navigator__c where fullname__c=:str and createdbyid=:userid limit 1];
     //patient.Assigned_Navigator__c=mapval.get(str);
    }
    //patient.distance__c=valuetwo;
    
    insert patient;
    pagereference p=new pagereference('/'+patient.id);
    return p;
    }
     Navigator__c n=new Navigator__c();    
    public void change()
    {
    selection=true;
    if(patient.Assigned_Navigator__c!=null)
    n=[select id,E_Address_1__c,City__c,states__C from Navigator__c where id=:patient.Assigned_Navigator__c];
    address1=n.E_Address_1__c+','+n.City__c+','+n.states__C;
    address2=patient.E_Address1__c+','+patient.City__c+','+patient.states__c+','+patient.Zip__c; 
    system.debug('address1'+address1+'Address2'+address2);
    
    //selectall();
     
    
    }
   public class wraperclass
   {
   public id id{set;get;}
   public string address{set;get;}
   public string E_Address1{set;get;}
   public string City{set;get;}
   public string country{set;get;}
   public boolean check{set;get;}
   public string addr{set;get;}
   public string cancertype{set;get;}
   public string fname{set;get;}
   public string lname{set;get;}
  }
   list<wraperclass> navilist=new list<wraperclass>();
   public string address{set;get;} 
   list<string> slist=new list<string>();
   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(pat.Type_of_Cancer__c!=null && pat.Gender__c!=null&&Lastname=='')
 {
 //cancer type and Gender
  for(Navigator__c nv:[select fullname__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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,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;
   address22=address22+nv.id+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,name,E_Navigator_Last_Name__c ,E_Address_1__c,City__c,states__C,Type_of_Cancer__c from Navigator__c where Type_of_Cancer__c=:patient.Cancer_Type__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;
   address22=address22+nv.id+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; 
    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 void Coordinates(string add1 ,string add2)
{
  string url='http://maps.googleapis.com/maps/api/distancematrix/xml?origins='+add1+'&destinations='+add2+'&mode=driving&language=en&sensor=false';
   //string url='http://maps.googleapis.com/maps/api/distancematrix/xml?origins=hyderabad&destinations=banglore|kurnool|delhi&mode=driving&language=en&sensor=false';
    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();
string[] Coordinates = responseBody.split(',',0);
  XmlStreamReader reader = res.getXmlStreamReader();*/
   XmlStreamReader reader;
            if(!isApexTest)
              { 
                 HttpResponse res = h.send(req);
                 String responseBody = res.getBody();
                 reader= res.getXmlStreamReader();
                 
               }
               else
               {
                string body='<text>4455</text>';
                reader=new XmlStreamReader(body);
                
               }
  readXMLResponse(reader); 
 
} 
public String mainForTest(){
        isApexTest = true;
        return '';
    }
   public String readXMLResponse(XmlStreamReader reader)
  {
     wlist=new list<navclass>();
     string retValue; // Read through the XML
     integer i=0;
     while(reader.hasNext())
    {
  
    if (reader.getEventType() == XmlTag.START_ELEMENT)
    {
      
      
      if (reader.getLocalName()=='text') 
      {
      
          reader.next();
        if (reader.getEventType()==XmlTag.characters)
       {
          retValue= reader.getText();
          system.debug('*********'+retvalue);
            navclass w=new navclass();
            //w.distanceval=1;
          if(retvalue.substring(retvalue.length()-2,retvalue.length())=='km')
          {
           sample=string.valueof(retvalue);
         
           retValue=retValue.replace(',','');
           integer value=integer.valueof(retValue.substring(0,retValue.length()-3)); 
           w.distanceval=value*0.62; 
            
           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();
      
 }
 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 decimal 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;}
}
  /*  
public static testMethod void mytest()
{
navigator__c n=new navigator__c(name='aaa',states__C='lowa',Date_of_Entry__c=system.today(),E_Navigator_Last_Name__c='lab',Zip_Code__c='5688876552',Ethnic_Racial__c='Asian',Date_of_Birth__c=system.today(),Last_name__c='l',Type_of_Cancer__c='**bleep** Cancer',Gender__C='male',Been_Through_Orientation__c=true);

insert n;
patient__c p=new patient__c (E_Electronic_Chart_ID__c='aa1',E_LastName__c='abc',Cancer_Type__c='**bleep** Cancer');
//insert p;
ApexPages.StandardController sc = new ApexPages.standardController(p);
newpatient np=new newpatient(sc); 
String retVal =np.mainForTest();

wraperclass w=new wraperclass();
test.starttest();

np.finding();
np.filtering();
test.stoptest();
}
public static testMethod void mytest2()
{
navigator__c n=new navigator__c(name='aaa',states__C='lowa',Date_of_Entry__c=system.today(),E_Navigator_Last_Name__c='lab',Zip_Code__c='5688876552',Ethnic_Racial__c='Asian',Date_of_Birth__c=system.today(),Last_name__c='l',Type_of_Cancer__c='**bleep** Cancer',Gender__C='male',Been_Through_Orientation__c=true);

insert n;
patient__c p=new patient__c ();
//insert p;
ApexPages.StandardController sc = new ApexPages.standardController(p);
newpatient np=new newpatient(sc); 
String retVal =np.mainForTest();

wraperclass w=new wraperclass();
System.test.starttest();

//np.mainForTest();
np.filtering();
system.test.stoptest();
}*/

private static testMethod void mytest()
{
      navigator__c n=new navigator__c(name='aaa',states__C='lowa',Date_of_Entry__c=system.today(),E_Navigator_Last_Name__c='lab',Zip_Code__c='5688876552',Ethnic_Racial__c='Asian',Date_of_Birth__c=system.today(),Last_name__c='l',Type_of_Cancer__c='**bleep** Cancer',Gender__C='male',Been_Through_Orientation__c=true);
      insert n;
      patient__c p=new patient__c (E_Electronic_Chart_ID__c='aa1',E_LastName__c='abc');

      ApexPages.StandardController sc = new ApexPages.standardController(p);
      newpatient np=new newpatient(sc); 
      
      newpatient np1=new newpatient (sc); 
      newpatient np2=new newpatient (sc);
      newpatient np3=new newpatient (sc);
      newpatient np4=new newpatient (sc);
      newpatient np5=new newpatient (sc);
      wraperclass w=new wraperclass();

    w.id=n.id;
    w.E_Address1=n.E_Address_1__c;
    w.City=n.city__c;
   // w.country=n.County__c;
    w.address=n.name+';'+n.E_Address_1__c+','+n.city__c+','+n.states__C+';'+n.Type_of_Cancer__c;
    np.address=w.address;
    np.navilist.add(w);
    np.lastname='l';
    np.valueOne='aaa';
    np.patient.Cancer_Type__c='**bleep** Cancer';
        PageReference pageRef = Page.newpatient; 
        Test.setCurrentPage(pageRef); 
        ApexPages.currentPage().getParameters().put('one','aaa'); 
    np.patient.E_Electronic_Chart_ID__c='aab';
    np.patient.E_LastName__c='aac';
    np.pat.Type_of_Cancer__c='**bleep** Cancer';
    np1.pat.Type_of_Cancer__c='**bleep** Cancer';
    np1.lastname='l';
    np1.pat.Gender__C='male';
       np2.pat.Gender__C='male';
       np3.lastname='l';
       np4.pat.Gender__C='male';
       np4.lastname='l';
       np5.pat.Type_of_Cancer__c='**bleep** Cancer';
       test.starttest();
     
     np.getpatient();
     
     np.change();
     np.getnavilist();
     np.selectall();
     np.finding();
     np.filtering();
     np1.filtering();
     np2.filtering();
     np3.filtering();
     np4.filtering();
     np5.filtering();
     np.saverec();
     np.setpat(n);
     np.getpat();
     test.stoptest();
}

 

}

Duration: 2-3 days initial, 2-3 hrs / week ongoing

 

Location: Seattle, WA

 

Skills needed:

- Administration experience with Salesforce configurations

- Experience using Apex classes, APEX Web services, and API

- Experience building automated tests with Apex

- Excellent written and verbal English skills

 

Nice to haves:

- Certified Salesforce developer

- Certified Salesforce administrator

 

Primary responsibilities:

- Provide our organization consolation for best practices

- Ongoing maintenance of existing SFDC infrastructure, helping with 1 project per month with additional consultation hours as needed

 

Please reply with the following information:

- Your current timezone and hours of availability during PST

- How many hours are you available per week, when you are available to begin

- What is your hourly rate?

- Will you be willing to provide us with 2 client references that we may contact as part of the interview process

Need Bigmachines Developer . 

 

Start ASAP

 

 

Hi  I i am getting following error when try to update bulk of records  from system log

Too many SOQL queries: 101

trigger updatetrigg on Lead_Categories__c (before update)
{
list<Related_Team_Member__c > rtmlist=new list<Related_Team_Member__c >();

list<Related_Team_Member__c > tlist=new list<Related_Team_Member__c >();
list<teammember__c> teamlist=new list<teammember__c>();
list<teammember__C> tmlist=new list<teammember__C>();
for(Lead_Categories__c o:trigger.old)
{
for(Lead_Categories__c l:trigger.new)
{
teamlist=[select Access_Category__c,Access_Item__c,Access_Level__c from teammember__c where Access_Level__c=:l.Access_Level__c and  Access_Item__c=:l.Access_Item__c and Access_Category__c=:l.Access_Category__c limit 1];

if(o.accepted__c==false)
{
if(l.accepted__c==true && l.type__c=='Add')
{
//list<teammember__c> tlist1=[select Access_Category__c,Access_Item__c,Access_Level__c from teammember__c where Access_Level__c=:l.Access_Level__c and  Access_Item__c=:l.Access_Item__c and Access_Category__c=:l.Access_Category__c limit 1];

/*for(teammember__c team:tlist1)
{
teamlist.add(team);
}*/
if(teamlist.size()>0)
{
for(teammember__c team:teamlist)
{
Related_Team_Member__c rtm1=new Related_Team_Member__c(); 
rtm1.team__C=l.team__C;
rtm1.teammember__C=team.id;
l.teammember__c=team.id;

rtmlist.add(rtm1);
}
}
else
{
teammember__c t=new teammember__c();
t.Access_Category__c=l.Access_Category__c;
t.name=t.id;
t.Access_Item__c=l.Access_Item__c;
t.Access_Level__c=l.Access_Level__c;
t.team__c=l.team__c;
//insert t;
tmlist.add(t);
l.teammember__c=t.id;


}
}
if(l.accepted__c==true && l.type__c=='Remove')
{
for(Related_Team_Member__c tt:[select id from Related_Team_Member__c where teammember__c=:l.teammember__C and team__c=:l.team__C])
{
tlist.add(tt);

}
}
}
}
}
if(tlist.size()>0)
delete tlist;
if(tmlist.size()>0)
insert tmlist;
if(rtmlist.size()>0)
insert rtmlist;
}

 Whats wrong in my please let me know

 

 

thank you in advance

 

 



Hi 

I need a clarification on chatter plus .
I would like to see all chatter plus (account users) in lookup  field which held in custom object or standard object.Is it possible ? if possible then How?
Please Help Me In This Area.
thank you in advance
rajesh
Hi am using following code in  salesforce
to integrate with campaign monitor.
but i am getting errors like
12:47:38.666 (666977000)|CALLOUT_RESPONSE|[51]|System.HttpResponse[Status=Bad Request, StatusCode=400]

12:47:38.667 (667346000)|USER_DEBUG|[55]|DEBUG|********<?xml version="1.0" encoding="utf-8"?><Result><Code>400</Code><Message>Failed to deserialize your request.
Please check the documentation and try again.
Fields in error: client</Message></Result>


Please solve my problem.


public class lll {

public string errormessage;



 public  void Login()
    { 
     Http h = new Http();
        HttpRequest req = new HttpRequest();
        //ErrorMessage='';
       final string baseUrl = 'http://dskvapconsultancyservices.createsend.com/'; 
        final string username = '05b88f78dfc4f00ce93553a79be93d04'; 
        final string password = 'rajesh12';
       
  string apikey='05b88f78dfc4f00ce93553a79be93d04';
     Blob headerValue = Blob.valueOf(username + ':' + password);
     String authorizationHeader = 'BASIC ' +
     EncodingUtil.base64Encode(headerValue);
     req.setHeader('Host','http://api.createsend.com');
    req.setHeader('Content-length', '1753' );
    req.setHeader('Content-Type', 'text/xml;charset=UTF-8');
    req.setHeader('Authorization',authorizationHeader);
    //req.setHeader('Authorization','Basic 05b88f78dfc4f00ce93553a79be93d04==');
  //req.setHeader('content-type', 'text/xml;charset=utf-8');
  //req.setHeader('Content-Length','1024');
  //req.setHeader('Host','http://dskvapconsultancyservices.createsend.com/');
  //req.setHeader('Connection','keep-alive');
     string body1='<?xml version="1.0" encoding="utf-8"?>';
      body1+='<Clients> ';
      /*body1+='<ApiKey>05b88f78dfc4f00ce93553a79be93d04</ApiKey>';
      body1+='<AccessDetails>';
          body1+='<Username>05b88f78dfc4f00ce93553a79be93d04</Username>';
          body1+='<AccessLevel>23</AccessLevel>';
          body1+='</AccessDetails>';*/
          body1+='<Client>';
          body1+='<ClientID></ClientID>';
          body1+='<Name></Name>';
          body1+='</Client>';
         body1+='</Clients>';   
        
        req.setMethod('GET');
        req.setBody(body1);

        //req.setEndpoint(baseUrl + '?loginType=&un='+username+'&pw='+password);
       //req.setEndpoint('http://api.createsend.com/05b88f78dfc4f00ce93553a79be93d04/v3/clients/clients.xml');
        req.setEndPoint('http://api.createsend.com/api/v3/clients.xml');
        //req.setbody('http://api.createsend.com/api/v3/clients.xml');
    
        
        HttpResponse res = h.send(req);
         //req.setEndpoint(baseUrl + 'apex/UploadFile_DifferentOrg');
           
          //res = h.send(req);
           system.debug('********'+res.getbody());
           if (res.getBody().indexOf('success=true')>-1)
           {
              system.debug('Success');
           }  
        }
        
        public void detail()
        {
        
        }
        
        
}

 thank you in advance

rajesh

public class lll {
public string errormessage;
@future (callout=true)
 public static void Login()
    {
        
        //ErrorMessage='';
       final string baseUrl = 'http://dskvapconsultancyservices.createsend.com/'; 
        final string username = '05b88f78dfc4f00ce93553a79be93d04'; 
        final string password = 'rajesh12';
       
  string apikey='05b88f78dfc4f00ce93553a79be93d04';
     Blob headerValue = Blob.valueOf(username + ':' + password);
     String authorizationHeader = 'BASIC ' +
     EncodingUtil.base64Encode(headerValue);
     //req.setHeader('Host','http://api.createsend.com');
  //req.setHeader('Content-length', '1753' );
 // req.setHeader('Content-Type', 'text/xml;charset=UTF-8');
    //req.setHeader('Authorization',authorizationHeader);
  //req.setHeader('content-type', 'text/xml;charset=utf-8');
  //req.setHeader('Content-Length','1024');
  //req.setHeader('Host','http://dskvapconsultancyservices.createsend.com/');
  //req.setHeader('Connection','keep-alive');
     string body1='<?xml version="1.0" encoding="utf-8"?>';
      body1+='<Clients> ';
      body1+='<ApiKey>05b88f78dfc4f00ce93553a79be93d04</ApiKey>';
      /*body1+='<AccessDetails>';
          body1+='<Username>05b88f78dfc4f00ce93553a79be93d04</Username>';
          body1+='<AccessLevel>23</AccessLevel>';
          body1+='</AccessDetails>';
          body1+='<CompanyName>My Company</CompanyName>';
          body1+='<ContactName>John</ContactName>';
          body1+='<EmailAddress>john@example.com</EmailAddress>';
          body1+='<Country>Australia</Country>';
          body1+='<TimeZone>(GMT+10:00) Canberra, Melbourne, Sydney</TimeZone>';*/
         body1+='</Clients>';   
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setMethod('GET');
        req.setBody(body1);

        //req.setEndpoint(baseUrl + '?loginType=&un='+username+'&pw='+password);
       //req.setEndpoint('http://api.createsend.com/05b88f78dfc4f00ce93553a79be93d04/v3/clients/clients.xml');
        req.setEndPoint('http://api.createsend.com/api/v3/clients.xml');
        //req.setbody('http://api.createsend.com/api/v3/clients.xml');
    
        
        HttpResponse res = h.send(req);
         //req.setEndpoint(baseUrl + 'apex/UploadFile_DifferentOrg');
           
          //res = h.send(req);
           system.debug('********'+res.getbody());
           if (res.getBody().indexOf('success=true')>-1)
           {
              system.debug('Success');
           }  
        }
}

 Hi i am trying the above code to get details of clients which are in campaign monitor 

 

but i am getting following error

 

 

10:55:01.657 (657169000)|USER_DEBUG|[52]|DEBUG|********<?xml version="1.0" encoding="utf-8"?><Result><Code>50</Code><Message>Must supply a valid HTTP Basic Authorization header</Message></Result>

 

|[48]|System.HttpResponse[Status=Unauthorized, StatusCode=401]

 

 

 

 

what should i do get output by using by using above code

 

 

can you please give the details regarding this 

 

please help me with modify the above code if possible.

 

thank you in advance..


 
 
public class lll {
public string errormessage;
 public void Login()
    {
        
        ErrorMessage='';
       final string baseUrl = 'http://dskvapconsultancyservices.createsend.com/'; 
        final string username = '05b88f78dfc4f00ce93553a79be93d04'; 
        final string password = 'rajesh12';
       
  string apikey='05b88f78dfc4f00ce93553a79be93d04';
     Blob headerValue = Blob.valueOf(username + ':' + password);
     String authorizationHeader = 'BASIC ' +
     EncodingUtil.base64Encode(headerValue);
     req.setHeader('Host','http://dskvapconsultancyservices.createsend.com/');

    req.setHeader('Authorization',authorizationHeader);
  //req.setHeader('content-type', 'text/xml;charset=utf-8');
  //req.setHeader('Content-Length','1024');
  //req.setHeader('Host','http://dskvapconsultancyservices.createsend.com/');
  //req.setHeader('Connection','keep-alive');
        
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setMethod('GET');
        //req.setEndpoint(baseUrl + '?loginType=&un='+username+'&pw='+password);
       //req.setEndpoint('http://api.createsend.com/05b88f78dfc4f00ce93553a79be93d04/v3/clients/clients.xml');
        req.setEndPoint('http://api.createsend.com/api/v3/clients.xml?='+apikey);
        //req.setbody('http://api.createsend.com/api/v3/clients.xml');
    
        
        HttpResponse res = h.send(req);
         //req.setEndpoint(baseUrl + 'apex/UploadFile_DifferentOrg');
           
           res = h.send(req);
           system.debug('********'+res.getbody());
           if (res.getBody().indexOf('success=true')>-1)
           {
              system.debug('Success');
           }  
        }
}

 HI I am using this code to connect campaign monitor 

bit i am getting error  that null pointer defference

please let me know the actual way to headers and endpoint and body 

please expain how to set and what to set in headers for basic authorization

 

 

 

thank you in advance


 

 

Hi All

I three custom objects those are Community_Member__c,question__c.answer__c

 when i tried the following query

Community_Member__c c=[select name,(select header__c from question__r ) from Community_Member__c ];

its giving following error

Compile Error: line 1, column 23: Didn't understand relationship 'question__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

here paren is Community_Member__c 

child is question__c

 

 

please help why i am getting error

 

 

 

thank you in advance

 

 

rajesh

Hi All

I three custom objects those are Community_Member__c,question__c.answer__c

 when i tried the following query

Community_Member__c c=[select name,(select header__c from question__r ) from Community_Member__c ];

its giving following error

Compile Error: line 1, column 23: Didn't understand relationship 'question__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

here paren is Community_Member__c 

child is question__c

 

 

please help why i am getting error

 

 

 

thank you in advance

 

 

rajesh

hi

i wanna recieve mails from different domains(like gmail,yahoo,etc) to my site(which i have created in salesforce).

like inbound messages in salesforce

 

is there that chance

can i reciecve mails to my site

please help me with detail explanation

 

 

thank you in advance

 

global class remoteTest1 {  

    

     @RemoteAction 

     global static Contact[] findContacts(string Name) {  

        Name = '%'+Name+'%';  

         Contact[] c = [SELECT ID, Name, Phone, Email from Contact where NAME LIKE :Name ];      
             return c;  

    }  

    

 }

 

 

 this is the code for remoting 

in that i am not getting values of account 

please help me

 

 

hi all this is my code

 

public class docs 

{

list<document> dlist=new list<document>();

public docs()

{for(document d:[select name from document limit 5])

{

dlist.add(d);

}

}

public list<document> getdlist()

{return dlist;}}

i am getting error like.Error: docs Compile Error: Loop variable must be an SObject or list of Document at line 6 column 14

 

whats wrong in my code please help me

Hi,

I am new to programming can any one help me please.i want to retrive data from database and display in VF pageblock table.

  • March 16, 2011
  • Like
  • 0

Hi,

Can anybody plz help me in training SFDC in BayArea..As i wanted to learn the course.I heard people saying its good to learn the course.can anybody provide the details of the institue...

thnks for the help...

I am able to create an Excel file with data from Salesforce using a VF page.  I need to be able to put some data on Worksheet 1 and other data on Worksheet 2.  Is it possible to specify the worksheet?

 

If not, how would I do this?

 

Thanks for any ideas...

 

Hi i was wondering what is the code or query to get most recent record i.e. what i am trying to do is attaching a task
to one record which has to be the most recent one if there are more than one of the record i want to update.