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

How to set value from Apex..Pls..


I've List button attached VF page on 'Sys' Object .This Vf page has input fields of 'Comp' Object and I need to populated

selected 'Sys' obj records tot amt into one of 'Comp' obj input field while loading...

In controller I got the tot amt of selected 'Sys' obj record..

So How to populate one obj amt value from apex controller to  VF page input field???

   public Comp__c comp{get;set;}

   public SYS__c sys{get;set;}
    List<FTS__c> arrySys=new List<FTS__c>();

 public Sysextn(ApexPages.StandardSetController controller) {
    arrySys= (List<Sys__c>) controller.getSelected();
         ----} some code 
 System.debug('TotAmt******'+TotAmt); --> getting Amt of selected SYS record.
     comp.amt__c=TotAmt; --> Getting null pointer exception..

<apex:page standardcontroller="Sys__c" extensions="Sysextn" recordsetvar="ft">

<apex:pageBlockSection columns="2" >
<apex:inputField value="{!}" /> 
<apex:inputField value="{!comp.amt__c}" /> -> how to assign Totamt into this...



you probably need to create an instance of comp somewhere..

comp = new comp__c();