function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
katana_CROkatana_CRO 

How to insert data through a VisalForce page

Hi!

 

I'm new to VisualForce development and i have a question. Now I understand how to use VisualForce pages to present the Force Site data to end-users. But, is there a way to make a VisualForce page through which the end users can input data back into the SalesForce application (database). Basically, I want to provide the funcionality to insert new data through a VisualForce page.

 

Thank you!

Best Answer chosen by Admin (Salesforce Developers) 
krishnagkrishnag

hi ,

inserting data into an object through visual force is done by form

 

<apex:page>
<apex:form>

<apex:outputtext> First Name</apex:outputtext>
<apex:inputtext value="{!fname}"/>
<apexcommanButton value="submitt" action="{!save}"/>


</apex:form>
</apex:page>

 

 

In the above example first name is a input field where user types in the data

 

for submiit button we need to write a method to insert the data.

 

So the background logic is taken care by apex controller which u need to write a apex class for fetching the data and inserting . 

 

All Answers

krishnagkrishnag

hi ,

inserting data into an object through visual force is done by form

 

<apex:page>
<apex:form>

<apex:outputtext> First Name</apex:outputtext>
<apex:inputtext value="{!fname}"/>
<apexcommanButton value="submitt" action="{!save}"/>


</apex:form>
</apex:page>

 

 

In the above example first name is a input field where user types in the data

 

for submiit button we need to write a method to insert the data.

 

So the background logic is taken care by apex controller which u need to write a apex class for fetching the data and inserting . 

 

This was selected as the best answer
katana_CROkatana_CRO

That's all I needed to hear...

 

Thank you very much!

krishnagkrishnag

you are welcome if you think your question is answered please mark the answer as solution.

katana_CROkatana_CRO

Done! :)