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
zeezackzeezack 

Pullout data from database

How to a get database information... last id inserted

then pass that variable into a second web form?

1986anuj1986anuj

Hi zeezack,

 

You can get the data from database by quering

 

select (value to get)  from (table name) in an apex class and returning it into the datatype its of type..

 

The controller will mostly look like

 

 

public class (class name){ data type (variable name); public variable (function name)() { return (variable) = [select (columns to get) from (tablename)]; } }

 

 and your visualforce code will be like - 

 

 

<apex:page controller="(apex class name)"><apex:form><apex:pageBlock title="Hello {!$User.FirstName}!"><apex:inputField value="{!method_name.column_name}"/> <p/></apex:pageBlock></apex:form></apex:page>

 

 

 

 

 

 

 

zeezackzeezack

Hey ya man,

thanks for the reply. I'm able to pull out information

 

but how do I get the lastid - inserted - like the php command

 

then pass that into a web form?