Professional Documents
Culture Documents
public newpage(){
Rid = apexpages.currentpage().getparameters().get ('id');
opp = new opportunity();
opli = new Opportunity_Line_Item__c ();
}
VF PAGE
<apex:page controller="newpage" >
<apex:sectionHeader title="Add Custom Product" subtitle="new custom product"/>
<apex:form >
<apex:pageBlock title="Add custom Product" >
<apex:pageBlockButtons / >
<apex:commandButton value="save" action="{!Save}" />
<apex:commandButton value="Cancel" action="{!Cancel}"/>
<apex:commandButton value="add row" action="{!AddRow}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
EditALL
<apex:page controller="EditAll" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Update all" action="{!save}"/>
<apex:commandButton value="cancel" action="{!cancel}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
public newcustomrec(){
rec=Apexpages.currentpage().getparameters().get('id');
system.debug(rec);
opp= new opportunity();
opli= new Opportunity_Line_Item__c();
oplist= new list<Opportunity_Line_Item__c>();
}
public pagereference addrow(){
Opportunity_Line_Item__c opli2 = new Opportunity_Line_Item__c();
opli2.opportunities__c=rec;
oplist.add(opli2);
return null;
}
public void saveit(){
insert oplist;
}
<apex:page controller="newcustomrec" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="addrow" action="{!addrow}"/>
<apex:commandButton value="save" action="{!saveit}"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!oplist}" var="pp" >
<apex:column headerValue="GST"/>
<apex:inputField value="{!pp.GST__c}"/>
<apex:column />
<apex:column headerValue="GST"/>
<apex:inputField value="{!pp.HSN_Code__c}"/>
<apex:column />
<apex:column headerValue="GST"/>
<apex:inputField value="{!pp.GST__c}"/>
<apex:column />
<apex:column headerValue="GST"/>
<apex:inputField value="{!pp.GST__c}"/>
<apex:column />
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:outputField value="{!opp.name}"/>
<apex:outputField value="{!opp.Contact__c}"/>
<apex:outputField value="{!opp.CloseDate__c}"/>
<apex:outputField value="{!opp.LeadSource__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="Totals" collapsible="false">
<apex:inputField value="{!qt.Subtotal__c}" />
<apex:inputField value="{!qt.List_Price__c}" />
<apex:inputField value="{!qt.Discount__c}" />
<apex:inputField value="{!qt.Unit_Price__c}" />
<apex:inputField value="{!qt.Total_Amount__c}" />
</apex:pageBlockSection>
<apex:pageBlockSection title="Address Information" collapsible="false">
<apex:inputField value="{!qt.Shipping_Name__c}" />
<apex:inputField value="{!qt.Additional_Name__c}" />
<apex:inputField value="{!qt.Shiping_Address__c}" />
<apex:inputField value="{!qt.Billing_Address__c}" />
</apex:pageBlockSection>
<apex:pageBlockSection title="Product Details" collapsible="false">
<apex:pageBlockTable value="{!oplist}" var="a" border="1">
<apex:column value="{!a.x1Opportunity__c}"/>
<table>
<tr><th>Account Name:</th>
<td><apex:outputField value="{!opp.name}"/></td>
</tr>
<tr><th>Customer Requirement:</th>
<td><apex:outputField value="{!opp.Stage__c}"/></td>
</tr>
<tr><th>Date:</th>
<td><apex:outputField value="{!opp.CloseDate__c}"/>
<apex:param value="{!opp.Account__c}"/></td>
</tr>