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
scriptagentscriptagent 

insert new value / input field

Hi @ all,
 
I want to display a empty input field on a visual page. The customer should be able to enter a number in this input field.
After clicking the "save button", the number should be saved.
 
I found a example for a standart controller, but I need a custom controller for my own custom object.
How can I realize this ?
 
Thank you very much!
pete
 
scriptagentscriptagent

I have found a solution...maybe someone is interested:

apex Code:
//...   
public double sellprice {get;set;}
  
public apextest_sell__c edit() 
{
      
   insert new apextest_sell__c[]{new apextest_sell__c(sellprice__c=sellprice)};
   return null;
}
visualpage Code:
 <apex:inputText value="{!sellprice}" id="sellprice"/>  
 <apex:commandButton value="Send" action="{!edit}" />