• @RohitSingh
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am sending XMLHttpRequest using apex but unfortunately below Error is Coming
Error Bed Request Your browser sent a request that this server could not understand
Here is my code.

public class A99AcresIntegration{
public static void makeGetCallout(){ String User_name = 'XXXXXXXX'; String Pwd = 'XXXXXXXXX'; DateTime Startdate = system.now()- 2; DateTime EndDate = system.now(); Http http = New Http(); HttpRequest request = new HttpRequest(); request.setEndpoint('http://www.99acres.com/99api/v1/getmy99Response/OeAuXClO43hwseaXEQ/uid/<?xml version=1.0+?><query><user_name> '+User_name+'</user_name><pswd>'+Pwd+'</pswd><start_date>'+Startdate+'</start_date><end_date>'+EndDate+'</end_date></query>'); request.setMethod('POST'); request.setHeader('Content-Type','Text/xml'); HttpResponse response = http.send(request);
}
}
Hello i was trying to display info from my Wrapper Class to VF Page but i am not able to find where i was doing wrong .. could someone please help me out with this.

here are my controller and VF page codes.

VF Page
<apex:page controller="Aclist3">
  
  <apex:form >
      <apex:pageBlock >
          <apex:pageblockTable value="{!Mytablerow}" var="t">
                <apex:column value="{!t.theAccount.Name}"/>
                <apex:column value="{!t.theContact.Name}"/>
          </apex:pageblockTable>
              
      </apex:pageBlock>
              
   </apex:form>
</apex:page>

CONTROLLER



public class Aclist3 {

    public aTableRow getMytablerow() {
        return null;
    }

    Public List<aTableRow> tableRows {get; set;}
    public Aclist3()
        {
        
       List<aTableRow> tableRows = new List<aTableRow>();
       
       Account a = [SELECT Name FROM Account LIMIT 1];
       Contact c = [SELECT Name FROM Contact LIMIT 1];
       
       aTableRow Mytablerow = new aTableRow();
       
       MyTablerow.theAccount = a;
       MyTablerow.theContact = c;
             system.debug('temp******'+myTablerow.theAccount.Name);
        }

Public Class aTableRow
    {
        Public Account theAccount {get; set;}
        Public Contact theContact {get; set;}
        
        
    }
    
    
}
Trailhead chhalendge:
Create a flow to streamline entry of new accounts, contacts, and opportunities.

error: 
UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] --- for SFDC record with ID : null,