+ Start a Discussion
Sfdc11Sfdc11 

How to set value from Apex..Pls..

Hi,

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 
   
    TotAmt=TotAmt+SYS__c.Total__Amt__c;
 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="{!comp.name}" /> 
<apex:inputField value="{!comp.amt__c}" /> -> how to assign Totamt into this...

 

prady-cmprady-cm

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

comp = new comp__c();