You need to sign in to do that
Don't have an account?
amrit bansal
VF Page:
<apex:page controller="hb1" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:inputField value="{!alsat.name}"/>
<apex:inputField value="{!alsat.Date_and_Time_of_allotment__c}"/>
<apex:inputField value="{!alsat.Hotels_Lodges__c}"/>
<apex:inputField value="{!alsat.Booking_Period__c}"/>
<apex:inputField value="{!alsat.Members__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
controller:
public class hb1 {
alloted_satsangi__C alsat;
public void setalsat(alloted_satsangi__C al){
alsat = new alloted_satsangi__C();
alsat.name = al.name;
alsat.Date_and_Time_of_allotment__c=al.Date_and_Time_of_allotment__c;
alsat.Hotels_Lodges__c=al.Hotels_Lodges__c;
alsat.Booking_Period__c=al.Booking_Period__c;
alsat.Members__c=al.Members__c;
}
public alloted_satsangi__C getalsat(){
return alsat;
}
public void save(){
insert alsat;}
}
could not able to set field values of custom object type variable from visualforce page <inputfield>,my code is following
VF Page:
<apex:page controller="hb1" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="save" action="{!save}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:inputField value="{!alsat.name}"/>
<apex:inputField value="{!alsat.Date_and_Time_of_allotment__c}"/>
<apex:inputField value="{!alsat.Hotels_Lodges__c}"/>
<apex:inputField value="{!alsat.Booking_Period__c}"/>
<apex:inputField value="{!alsat.Members__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
controller:
public class hb1 {
alloted_satsangi__C alsat;
public void setalsat(alloted_satsangi__C al){
alsat = new alloted_satsangi__C();
alsat.name = al.name;
alsat.Date_and_Time_of_allotment__c=al.Date_and_Time_of_allotment__c;
alsat.Hotels_Lodges__c=al.Hotels_Lodges__c;
alsat.Booking_Period__c=al.Booking_Period__c;
alsat.Members__c=al.Members__c;
}
public alloted_satsangi__C getalsat(){
return alsat;
}
public void save(){
insert alsat;}
}
Paste back the removed code of the page.