• ankitha varra
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 19
    Replies
Hai,
  there  is a scenario there i want to test site.login(username,password,starturl)  in salesforce

Hai,
I have auto number field in my Object as label  Account number , i have created a email template wuth autonumber field <Accounts__c.Name>
.but when i send the email to the reciepients the value of the field is some other field value.
How to display the autonumber field value in email template while sending  outbound email

VF page

<apex:page standardController="Accounts__c" extensions="YesBankAccount" >
<apex:form >
  <apex:selectList size="1" value="{!selResult}" >
<apex:selectOptions value="{!selOptions}" />
</apex:selectlist>

<apex:commandButton value="Go!" action="{!movingtoanotherpage}" />
</apex:form>
</apex:page>

Controller

  Public pagereference movingtoanotherpage(){
     
    if(Selresult == 'Create Account'){
    PageReference pageRef = new PageReference('/apex/YesBankAccountPage');
         Pageref.setredirect(true);
            return pageRef;
   }
    else if(selresult=='show contacts')
    return null; 
    return null;
  }
Whenever we select the value create contact it should navigate to another page,
whenever we select the the value show contacts it should rendered the page block,
but i thought that value is not passing from visual force page to controller
 
Vf page
<apex:selectList size="1" value="{!selResult}" >
<apex:selectOptions value="{! selOptions}" />
</apex:selectlist>
<apex:commandButton value="Go!" action="{!movingtoanotherpage}" />

controller

 Public pagereference movingtoanotherpage(){
     
    if(Selresult=='Create Account'){
    
    PageReference pageRef = new PageReference('/apex/YesBankAccountPage');
          Pageref.setredirect(true);
            return pageRef;
   }
    return null; 
  }
It is not showing any errors even though pagereference is not working
 
<apex:page standardController="Accounts__c" extensions="YesBankAccount" showHeader="false" title="YES BANK">
<apex:composition template="YesBank_MenuBarTemplete">
</apex:composition>
<!--<apex:sectionHeader title="Account" subtitle="Home"/>-->
<style>
body .bPageBlock .pbBody .Orange .pbSubheader
{
background-color:#FF8C00;
}
body .bPageBlock .pbBody .OrangeRed .pbSubheader
{
background-color:#FF4500;
}
</style>
<apex:form >
<apex:pageBlock tabStyle="Account" title="New Account Form">
<apex:outputPanel styleClass="OrangeRed" layout="block" >
<apex:pageBlockSection title="Account Information" collapsible="false" columns="1">
<apex:pageBlockSectionItem >
<apex:outputLabel >Type Of Account</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Type_Of_Account__c}"  required="true">
<apex:actionsupport event="onchange" rerender="Guardian"/>
</apex:inputfield>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Priority</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Priority__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Amount</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Amount__c}" required="true"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>
    
<apex:outputPanel styleClass="OrangeRed" layout="block">
<apex:pageBlockSection title="Additional Services Required" collapsible="false" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel >Internet Banking</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Internet_Banking__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Mobile Banking</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Mobile_Banking__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Debit-Cum-ATM Card</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Debit_Card__c }"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Insurance</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Need_Insurance__c}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>
  
<apex:outputPanel styleClass="Orange" layout="block">  
<apex:pageBlockSection title="Personal Information" collapsible="false" columns="2" >
<apex:pageBlockSectionItem >
<apex:outputLabel >Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Name__c}"  required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Father Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Father_Name__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Mother Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Mother_Name__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Joint Holder Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Joint_Holder_Name__c}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
</apex:pageblocksection>

<apex:outputpanel id="Guardian" >
<apex:pageblocksection >
<apex:pageBlockSectionitem rendered="{!if(Accounts__c.Type_Of_Account__c='Minor',true,false)}">
<apex:outputlabel >Guardian Name</apex:outputlabel>
<apex:inputField value="{!Accounts__c.Guardian_Name__c}"/>
</apex:pageBlockSectionitem>
</apex:pageblocksection>
</apex:outputpanel>

<apex:pageblocksection >
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Date Of Birth</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Date_Of_Birth__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Age</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Age__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Mobile Number</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Mobile_Number__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Email</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Email__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Marital Status</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Marital_Status__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Spourse Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Spouse_Name__c}" />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>
 
<apex:outputPanel styleClass="OrangeRed" layout="block">
<apex:pageBlockSection title="Proofs Information" collapsible="false" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel >Identity Proofs</apex:outputLabel>
<apex:inputField value="{!Accounts__c.ID_Proofs__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Aadhaar ID</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Aadhaar_ID__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Driving License No</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Driving_License_No__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >PAN Number</apex:outputLabel>
<apex:inputField value="{!Accounts__c.PAN_Number__c}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Passport Number</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Passport_Number__c}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Voter ID</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Voter_ID__c}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Address Proofs</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Address_Proofs__c}" required="true"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>


<apex:outputPanel styleClass="Orange" layout="block">    
<apex:pageBlockSection title="Professional Information" collapsible="false" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel >Educational Qualification</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Educational_Qualification__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Type of Employement</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Type_Of_Employement__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Salary</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Salary__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Type of Organisation</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Type_Of_Organisation__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Type of Institute</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Type_Of_Institute__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Organization Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Organization_Name__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Educational Institute Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Educational_Institute_Name__c }"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Turn Over Per Annum</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Turn_Over_per_Annum__c}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>

<apex:outputPanel styleClass="Orange" layout="block"> 
<apex:pageBlockSection title="Address Information" collapsible="false" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel >Current Address</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Current_Address__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Permanent Address</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Permanent_Address__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >State</apex:outputLabel>
<apex:inputField value="{!Accounts__c.State_Current__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >State</apex:outputLabel>
<apex:inputField value="{!Accounts__c.State_Permanent__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >City</apex:outputLabel>
<apex:inputField value="{!Accounts__c.City_Current__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >City</apex:outputLabel>
<apex:inputField value="{!Accounts__c.City_Permanent__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Pin Code</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Pin_Code_Current__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Pin Code</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Pin_Code_Permanent__c }"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Copy if Both are Same</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Copy_if_both_are_Same__c  }"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>
    
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Submit"/>
<apex:commandButton value="Cancel"/>
</apex:pageBlockButtons>

</apex:pageBlock>
</apex:form>  
</apex:page>
I tried to hide and display the fields according to the picklist values,
but those are not Displaying
Vf page

<apex:inputField value="{!Accounts__c.Type_Of_Account__c}"  required="true">
<apex:actionsupport event="onchange" rerender="Guardian"/>
</apex:inputfield>
<apex:outputpanel id="Guardian" >
<apex:pageBlockSectionItem rendered="{!if(Accounts__c.Type_Of_Account__c='Minor',true,false)}" >
<apex:outputLabel >Guardian Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Guardian_Name__c}" />
</apex:pageBlockSectionItem>
</apex:outputpanel>

code is not working please help me
<apex:page standardController="Lead" >
  <apex:form >
  <apex:pageblock >
  <apex:pageblockSection >
  <apex:pageblocksectionItem >
   <apex:outputLabel >Lead Name</apex:outputLabel>
   <apex:inputfield value="{!Lead.name}" rendered="{!if(Lead.Status='Closed-Converted',true,false)}" id="Leadname"/>
  </apex:pageblocksectionItem>
  <apex:inputfield value="{!Lead.status}">
  <apex:actionSupport event="Onselect"  reRender="Leadname"/>
  </apex:inputfield>
  </apex:pageblockSection>
   </apex:pageblock>
  </apex:form>
</apex:page>

i am not getting any errors , even though  its not working
Hai, i have 40000 thousands of records ,those records will be display on the visualforce page, pls do some help
 I want to connect two salesforce organizations, while connecting am getting the above error

<apex:page standardcontroller="account" extensions="workbench" >
 <apex:form >
  <apex:pageBlock >
  <apex:pageblocksection title="workbench insert">
  <apex:inputfield value="{!acc.Name}"/>
  <apex:outputtext > {!jsondata}</apex:outputtext>

  <apex:commandbutton value="Post" action="{!getrecords}"/>
  </apex:pageblocksection>
  </apex:pageBlock>
 
 </apex:form>
</apex:page>
 
public class workbench {

    public workbench(ApexPages.StandardController controller) {
   
    }


public list<account> table{get;set;}
public string jsondata {get;set;}
public string res1 {get;set;}
public account acc{get;set;}

public pagereference getrecords(){
   Http h = new Http();
       account acc= new account();
list<account> acclist= new list<account>();
                String reqbody='grant_type=password&client_id=3MVG9ZL0ppGP5UrC3Dw9S2gx8uugsVTSNUl5gXKlKaMM58wdzzuFgcEKkK.t4AJEHVlicDe7UhkvK7JMxmLlz&client_secret=2477145618947115896&username=satishmylaproject@sfdc.com&password=anuradha1234';

                
                HttpRequest req = new HttpRequest();
                req.setBody(reqbody); 
                
                req.setEndpoint('https://login.salesforce.com/services/oauth2/token');
                req.setHeader('Content-Type','application/x-www-form-urlencoded');
                req.setMethod('POST');
                HttpResponse res = h.send(req);
                System.debug('Response for retrieving access token=='+res.getBody()); 
                 res1=res.getbody();
                Oauth2 oauth=(Oauth2)JSON.deserialize(res.getbody(),OAuth2.class);    
 
                HttpRequest req2 = new HttpRequest();
               req2.setHeader('Authorization','Bearer '+oauth.access_token);
                req2.setHeader('Content-Type','application/json; charset=UTF-8');
                req2.setHeader('Accept','application/json');
                String body = JSON.Serialize(acc);
               req2.setBody(body);
                req2.setEndpoint('https://ap2.salesforce.com/services/apexrest/accountinsert/*');
                req2.setMethod('POST');
                Http h2 = new Http();
                HttpResponse res2 = h2.send(req2);
                 jsonData = res2.getBody();
              
               return  null; 
        
    }
    
     //WrapperClass for OAuth
        public class OAuth2{
         public String id{get;set;}
         public String issued_at{get;set;}
         public String instance_url{get;set;}
         public String signature{get;set;}
         public String access_token{get;set;} 

}
}
 
@RestResource(urlMapping='/accountinsert/*')
global class insertionaccount{
 

@HttpPost
global static void insertaccount(String aname) {
account a = new account();
a.name=aname;
insert a;    
}    

}
I am using rest api to connect two salesforce organizations, and the code i have written is here
@RestResource(urlMapping='/accountinsert/*')
global class insertionaccount{
 

@HttpPost
global static void insertaccount() {
account a = new account();
string aname;
a.name=aname;
insert a;    
}    

}
<apex:page standardcontroller="account" extensions="workbench" >
 <apex:form >
  <apex:pageBlock >
  <apex:pageblocksection title="workbench insert">
  <apex:inputfield value="{!account.Name}"/>
  <apex:outputtext > {!jsondata}</apex:outputtext>

  <apex:commandbutton value="Post" action="{!getrecords}"/>
  </apex:pageblocksection>
  </apex:pageBlock>
 
 </apex:form>
</apex:page>
public class workbench {

    public workbench(ApexPages.StandardController controller) {
   
    }


public list<account> table{get;set;}
public string jsondata {get;set;}
public string res1 {get;set;}
public account acc{get;set;}

public pagereference getrecords(){
   Http h = new Http();
       account acc= new account();
list<account> acclist= new list<account>();
                String reqbody='grant_type=password&client_id=3MVG9ZL0ppGP5UrC3Dw9S2gx8uugsVTSNUl5gXKlKaMM58wdzzuFgcEKkK.t4AJEHVlicDe7UhkvK7JMxmLlz&client_secret=2477145618947115896&username=satishmylaproject@sfdc.com&password=anuradha1234';

                
                HttpRequest req = new HttpRequest();
                req.setBody(reqbody); 
                
                req.setEndpoint('https://login.salesforce.com/services/oauth2/token');
                req.setHeader('Content-Type','application/x-www-form-urlencoded');
                req.setMethod('POST');
                HttpResponse res = h.send(req);
                System.debug('Response for retrieving access token=='+res.getBody()); 
                 res1=res.getbody();
                Oauth2 oauth=(Oauth2)JSON.deserialize(res.getbody(),OAuth2.class);    
 
                HttpRequest req2 = new HttpRequest();
               req2.setHeader('Authorization','Bearer '+oauth.access_token);
                req2.setHeader('Content-Type','application/json; charset=UTF-8');
                req2.setHeader('Accept','application/json');
                String body = JSON.Serialize(acc);
               req2.setBody(body);
                req2.setEndpoint('https://ap2.salesforce.com/services/apexrest/accountinsert/*');
                req2.setMethod('POST');
                Http h2 = new Http();
                HttpResponse res2 = h2.send(req2);
                 jsonData = res2.getBody();
              
               return  null; 
        
    }
    
     //WrapperClass for OAuth
        public class OAuth2{
         public String id{get;set;}
         public String issued_at{get;set;}
         public String instance_url{get;set;}
         public String signature{get;set;}
         public String access_token{get;set;} 

}
}
but am getting required fields are missing,pls help me.....


 
what is the soap api  data limit..?

Can we schedule the integration that is done with dellboomi and after deploying the process from dell boomi to salesforce production can we maintain the dell boomi tool....?
I have two objects with lookup relationship those maintaince__c and discharge__c, maintaince object contains fields name,room__c wardno__c
i want to get the field  value room__c  from maintaince__c object    to the lookup relationship field  roomno__c in discharge object
where maintaince__c is the parent object and discharge__c is the child object,and name is the standard field,
for that i have written a trigger
trigger roomno on Discharge__c (after insert,after update) {
list<discharge__c> dc= new list<discharge__c>();

list<maintaince__c> ms=[select id,name,roomnumber__c from Maintaince__c];
list<discharge__c> ds=[select id ,name,room_no__c from discharge__c where id=:trigger.new[0].id ];

for(maintaince__c m: ms){
for(discharge__c d: ds){
if(d.id== m.id)
{
d.room_no__c=string.valueof(m.roomnumber__c);
dc.add(d);

}
}
}
update dc;
}
i want to update in the place of room_no__c of discharge__c with the value maintaince__c of roomnumber__c
I have two objects with lookup relationship those maintaince__c and discharge__c, maintaince object contains fields name,room__c wardno__c
i want to get the field  value room__c  from maintaince__c object    to the lookup relationship field  roomno__c in discharge object
where maintaince__c is the parent object and discharge__c is the child object,and name is the standard field
for that i have written a trigger
trigger roomno on Discharge__c (before insert,before update) {
list<discharge__c> dc= new list<discharge__c>();

list<maintaince__c> ms=[select id,name,roomnumber__c,(select id ,name ,room_no__c from discharges__r where id=:trigger.new[0].id) from Maintaince__c];
//list<discharge__c> ds=[select id ,name,room_no__c from discharge__c where id=:trigger.new[0].id ];

for(maintaince__c m: ms){
for(discharge__c d: m.discharges__r){
d.room_no__c= m.id;
dc.add(d);
}
}
update dc;
}

 but it does n't works, pls help me with some sample code
 

Hai,
I have auto number field in my Object as label  Account number , i have created a email template wuth autonumber field <Accounts__c.Name>
.but when i send the email to the reciepients the value of the field is some other field value.
How to display the autonumber field value in email template while sending  outbound email

VF page

<apex:page standardController="Accounts__c" extensions="YesBankAccount" >
<apex:form >
  <apex:selectList size="1" value="{!selResult}" >
<apex:selectOptions value="{!selOptions}" />
</apex:selectlist>

<apex:commandButton value="Go!" action="{!movingtoanotherpage}" />
</apex:form>
</apex:page>

Controller

  Public pagereference movingtoanotherpage(){
     
    if(Selresult == 'Create Account'){
    PageReference pageRef = new PageReference('/apex/YesBankAccountPage');
         Pageref.setredirect(true);
            return pageRef;
   }
    else if(selresult=='show contacts')
    return null; 
    return null;
  }
Whenever we select the value create contact it should navigate to another page,
whenever we select the the value show contacts it should rendered the page block,
but i thought that value is not passing from visual force page to controller
 
Vf page
<apex:selectList size="1" value="{!selResult}" >
<apex:selectOptions value="{! selOptions}" />
</apex:selectlist>
<apex:commandButton value="Go!" action="{!movingtoanotherpage}" />

controller

 Public pagereference movingtoanotherpage(){
     
    if(Selresult=='Create Account'){
    
    PageReference pageRef = new PageReference('/apex/YesBankAccountPage');
          Pageref.setredirect(true);
            return pageRef;
   }
    return null; 
  }
It is not showing any errors even though pagereference is not working
 
<apex:page standardController="Accounts__c" extensions="YesBankAccount" showHeader="false" title="YES BANK">
<apex:composition template="YesBank_MenuBarTemplete">
</apex:composition>
<!--<apex:sectionHeader title="Account" subtitle="Home"/>-->
<style>
body .bPageBlock .pbBody .Orange .pbSubheader
{
background-color:#FF8C00;
}
body .bPageBlock .pbBody .OrangeRed .pbSubheader
{
background-color:#FF4500;
}
</style>
<apex:form >
<apex:pageBlock tabStyle="Account" title="New Account Form">
<apex:outputPanel styleClass="OrangeRed" layout="block" >
<apex:pageBlockSection title="Account Information" collapsible="false" columns="1">
<apex:pageBlockSectionItem >
<apex:outputLabel >Type Of Account</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Type_Of_Account__c}"  required="true">
<apex:actionsupport event="onchange" rerender="Guardian"/>
</apex:inputfield>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Priority</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Priority__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Amount</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Amount__c}" required="true"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>
    
<apex:outputPanel styleClass="OrangeRed" layout="block">
<apex:pageBlockSection title="Additional Services Required" collapsible="false" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel >Internet Banking</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Internet_Banking__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Mobile Banking</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Mobile_Banking__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Debit-Cum-ATM Card</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Debit_Card__c }"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Insurance</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Need_Insurance__c}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>
  
<apex:outputPanel styleClass="Orange" layout="block">  
<apex:pageBlockSection title="Personal Information" collapsible="false" columns="2" >
<apex:pageBlockSectionItem >
<apex:outputLabel >Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Name__c}"  required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Father Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Father_Name__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Mother Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Mother_Name__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Joint Holder Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Joint_Holder_Name__c}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
</apex:pageblocksection>

<apex:outputpanel id="Guardian" >
<apex:pageblocksection >
<apex:pageBlockSectionitem rendered="{!if(Accounts__c.Type_Of_Account__c='Minor',true,false)}">
<apex:outputlabel >Guardian Name</apex:outputlabel>
<apex:inputField value="{!Accounts__c.Guardian_Name__c}"/>
</apex:pageBlockSectionitem>
</apex:pageblocksection>
</apex:outputpanel>

<apex:pageblocksection >
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Date Of Birth</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Date_Of_Birth__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Age</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Age__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Mobile Number</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Mobile_Number__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Email</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Email__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Marital Status</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Marital_Status__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Spourse Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Spouse_Name__c}" />
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>
 
<apex:outputPanel styleClass="OrangeRed" layout="block">
<apex:pageBlockSection title="Proofs Information" collapsible="false" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel >Identity Proofs</apex:outputLabel>
<apex:inputField value="{!Accounts__c.ID_Proofs__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Aadhaar ID</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Aadhaar_ID__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Driving License No</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Driving_License_No__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >PAN Number</apex:outputLabel>
<apex:inputField value="{!Accounts__c.PAN_Number__c}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Passport Number</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Passport_Number__c}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Voter ID</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Voter_ID__c}" />
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Address Proofs</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Address_Proofs__c}" required="true"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>


<apex:outputPanel styleClass="Orange" layout="block">    
<apex:pageBlockSection title="Professional Information" collapsible="false" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel >Educational Qualification</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Educational_Qualification__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Type of Employement</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Type_Of_Employement__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Salary</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Salary__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Type of Organisation</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Type_Of_Organisation__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Type of Institute</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Type_Of_Institute__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Organization Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Organization_Name__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Educational Institute Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Educational_Institute_Name__c }"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Turn Over Per Annum</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Turn_Over_per_Annum__c}"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>

<apex:outputPanel styleClass="Orange" layout="block"> 
<apex:pageBlockSection title="Address Information" collapsible="false" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel >Current Address</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Current_Address__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Permanent Address</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Permanent_Address__c}" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >State</apex:outputLabel>
<apex:inputField value="{!Accounts__c.State_Current__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >State</apex:outputLabel>
<apex:inputField value="{!Accounts__c.State_Permanent__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >City</apex:outputLabel>
<apex:inputField value="{!Accounts__c.City_Current__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >City</apex:outputLabel>
<apex:inputField value="{!Accounts__c.City_Permanent__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Pin Code</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Pin_Code_Current__c}"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Pin Code</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Pin_Code_Permanent__c }"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel >Copy if Both are Same</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Copy_if_both_are_Same__c  }"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
</apex:outputPanel>
    
<apex:pageBlockButtons location="bottom">
<apex:commandButton value="Submit"/>
<apex:commandButton value="Cancel"/>
</apex:pageBlockButtons>

</apex:pageBlock>
</apex:form>  
</apex:page>
I tried to hide and display the fields according to the picklist values,
but those are not Displaying
Vf page

<apex:inputField value="{!Accounts__c.Type_Of_Account__c}"  required="true">
<apex:actionsupport event="onchange" rerender="Guardian"/>
</apex:inputfield>
<apex:outputpanel id="Guardian" >
<apex:pageBlockSectionItem rendered="{!if(Accounts__c.Type_Of_Account__c='Minor',true,false)}" >
<apex:outputLabel >Guardian Name</apex:outputLabel>
<apex:inputField value="{!Accounts__c.Guardian_Name__c}" />
</apex:pageBlockSectionItem>
</apex:outputpanel>

code is not working please help me
I am using rest api to connect two salesforce organizations, and the code i have written is here
@RestResource(urlMapping='/accountinsert/*')
global class insertionaccount{
 

@HttpPost
global static void insertaccount() {
account a = new account();
string aname;
a.name=aname;
insert a;    
}    

}
<apex:page standardcontroller="account" extensions="workbench" >
 <apex:form >
  <apex:pageBlock >
  <apex:pageblocksection title="workbench insert">
  <apex:inputfield value="{!account.Name}"/>
  <apex:outputtext > {!jsondata}</apex:outputtext>

  <apex:commandbutton value="Post" action="{!getrecords}"/>
  </apex:pageblocksection>
  </apex:pageBlock>
 
 </apex:form>
</apex:page>
public class workbench {

    public workbench(ApexPages.StandardController controller) {
   
    }


public list<account> table{get;set;}
public string jsondata {get;set;}
public string res1 {get;set;}
public account acc{get;set;}

public pagereference getrecords(){
   Http h = new Http();
       account acc= new account();
list<account> acclist= new list<account>();
                String reqbody='grant_type=password&client_id=3MVG9ZL0ppGP5UrC3Dw9S2gx8uugsVTSNUl5gXKlKaMM58wdzzuFgcEKkK.t4AJEHVlicDe7UhkvK7JMxmLlz&client_secret=2477145618947115896&username=satishmylaproject@sfdc.com&password=anuradha1234';

                
                HttpRequest req = new HttpRequest();
                req.setBody(reqbody); 
                
                req.setEndpoint('https://login.salesforce.com/services/oauth2/token');
                req.setHeader('Content-Type','application/x-www-form-urlencoded');
                req.setMethod('POST');
                HttpResponse res = h.send(req);
                System.debug('Response for retrieving access token=='+res.getBody()); 
                 res1=res.getbody();
                Oauth2 oauth=(Oauth2)JSON.deserialize(res.getbody(),OAuth2.class);    
 
                HttpRequest req2 = new HttpRequest();
               req2.setHeader('Authorization','Bearer '+oauth.access_token);
                req2.setHeader('Content-Type','application/json; charset=UTF-8');
                req2.setHeader('Accept','application/json');
                String body = JSON.Serialize(acc);
               req2.setBody(body);
                req2.setEndpoint('https://ap2.salesforce.com/services/apexrest/accountinsert/*');
                req2.setMethod('POST');
                Http h2 = new Http();
                HttpResponse res2 = h2.send(req2);
                 jsonData = res2.getBody();
              
               return  null; 
        
    }
    
     //WrapperClass for OAuth
        public class OAuth2{
         public String id{get;set;}
         public String issued_at{get;set;}
         public String instance_url{get;set;}
         public String signature{get;set;}
         public String access_token{get;set;} 

}
}
but am getting required fields are missing,pls help me.....


 
I have two objects with lookup relationship those maintaince__c and discharge__c, maintaince object contains fields name,room__c wardno__c
i want to get the field  value room__c  from maintaince__c object    to the lookup relationship field  roomno__c in discharge object
where maintaince__c is the parent object and discharge__c is the child object,and name is the standard field,
for that i have written a trigger
trigger roomno on Discharge__c (after insert,after update) {
list<discharge__c> dc= new list<discharge__c>();

list<maintaince__c> ms=[select id,name,roomnumber__c from Maintaince__c];
list<discharge__c> ds=[select id ,name,room_no__c from discharge__c where id=:trigger.new[0].id ];

for(maintaince__c m: ms){
for(discharge__c d: ds){
if(d.id== m.id)
{
d.room_no__c=string.valueof(m.roomnumber__c);
dc.add(d);

}
}
}
update dc;
}
i want to update in the place of room_no__c of discharge__c with the value maintaince__c of roomnumber__c
I have two objects with lookup relationship those maintaince__c and discharge__c, maintaince object contains fields name,room__c wardno__c
i want to get the field  value room__c  from maintaince__c object    to the lookup relationship field  roomno__c in discharge object
where maintaince__c is the parent object and discharge__c is the child object,and name is the standard field
for that i have written a trigger
trigger roomno on Discharge__c (before insert,before update) {
list<discharge__c> dc= new list<discharge__c>();

list<maintaince__c> ms=[select id,name,roomnumber__c,(select id ,name ,room_no__c from discharges__r where id=:trigger.new[0].id) from Maintaince__c];
//list<discharge__c> ds=[select id ,name,room_no__c from discharge__c where id=:trigger.new[0].id ];

for(maintaince__c m: ms){
for(discharge__c d: m.discharges__r){
d.room_no__c= m.id;
dc.add(d);
}
}
update dc;
}

 but it does n't works, pls help me with some sample code