• cc_crm
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

I'm attempting to create my first VF page. It is a line-item entry form that will allow a user to enter multiple child records (Lit_Order_Detail__c) before clicking save. Right now, I'm opening the VF page from a custom button on the parent (Lit_Order__c). However, when the page opens, the lookup field for the parent is not populated - so the user has to click the lookup to select the parent from Lit_Order__c. Is there a way to pass the parent id of the previous page to the new child records on the VF page?

 

My Visualforce page:

 

 

<apex:page standardController="Lit_Order_Detail__c" extensions="OrderEntry"> <apex:form > <apex:pageBlock title="Sales Literature Orders Quick Entry" > <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}" rerender="error" /> </apex:pageBlockButtons> <apex:pageBlockTable value="{!ords}" var="a" id="table"> <apex:column headerValue="Order ID"> <apex:inputField value="{!a.Lit_Order__c}"/> </apex:column> <apex:column headerValue="Order Detail ID"> <apex:inputField value="{!a.Name}"/> </apex:column> <apex:column headerValue="Request"> <apex:inputField value="{!a.Literature_Request__c}"/> </apex:column> <apex:column headerValue="Quantity"> <apex:inputField value="{!a.Quantity__c}"/> </apex:column> </apex:pageBlockTable> <apex:pageblockButtons location="bottom"> <div style="text-align:right;margin-right:30px;font-weight:bold;"> <apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error" immediate="true" /> &nbsp;|&nbsp;&nbsp; <apex:commandLink value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" /> </div> </apex:pageblockButtons> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

 

My Apex class:

 

 

public class OrderEntry { public List<Lit_Order_Detail__c> ords {get; set;} public OrderEntry(ApexPages.StandardController myController) { ords = new List<Lit_Order_Detail__c>(); ords.add(New Lit_Order_Detail__c());} public void addrow() { ords.add(new Lit_Order_Detail__c());} public void removerow(){ Integer i = ords.size(); ords.remove(i-1);} public PageReference save() { insert ords; PageReference home = new PageReference('/home/home.jsp'); home.setRedirect(true); return home; }}

 

Thank you!

 

 

  • February 06, 2009
  • Like
  • 0
I'm using an outputfield to display the owner of my custom Project object in a VisualForce page - but I can't figure out how to add the [Change] link beside the owner name to enable the user to change the record owner.
 
Code:
 
<apex:outputfield value="{!Project__c.OwnerID}" />
 
Can anyone help? Thanks!
 
  • August 28, 2008
  • Like
  • 0

I'm attempting to create my first VF page. It is a line-item entry form that will allow a user to enter multiple child records (Lit_Order_Detail__c) before clicking save. Right now, I'm opening the VF page from a custom button on the parent (Lit_Order__c). However, when the page opens, the lookup field for the parent is not populated - so the user has to click the lookup to select the parent from Lit_Order__c. Is there a way to pass the parent id of the previous page to the new child records on the VF page?

 

My Visualforce page:

 

 

<apex:page standardController="Lit_Order_Detail__c" extensions="OrderEntry"> <apex:form > <apex:pageBlock title="Sales Literature Orders Quick Entry" > <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}" rerender="error" /> </apex:pageBlockButtons> <apex:pageBlockTable value="{!ords}" var="a" id="table"> <apex:column headerValue="Order ID"> <apex:inputField value="{!a.Lit_Order__c}"/> </apex:column> <apex:column headerValue="Order Detail ID"> <apex:inputField value="{!a.Name}"/> </apex:column> <apex:column headerValue="Request"> <apex:inputField value="{!a.Literature_Request__c}"/> </apex:column> <apex:column headerValue="Quantity"> <apex:inputField value="{!a.Quantity__c}"/> </apex:column> </apex:pageBlockTable> <apex:pageblockButtons location="bottom"> <div style="text-align:right;margin-right:30px;font-weight:bold;"> <apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error" immediate="true" /> &nbsp;|&nbsp;&nbsp; <apex:commandLink value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" /> </div> </apex:pageblockButtons> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

 

My Apex class:

 

 

public class OrderEntry { public List<Lit_Order_Detail__c> ords {get; set;} public OrderEntry(ApexPages.StandardController myController) { ords = new List<Lit_Order_Detail__c>(); ords.add(New Lit_Order_Detail__c());} public void addrow() { ords.add(new Lit_Order_Detail__c());} public void removerow(){ Integer i = ords.size(); ords.remove(i-1);} public PageReference save() { insert ords; PageReference home = new PageReference('/home/home.jsp'); home.setRedirect(true); return home; }}

 

Thank you!

 

 

  • February 06, 2009
  • Like
  • 0
I'm using an outputfield to display the owner of my custom Project object in a VisualForce page - but I can't figure out how to add the [Change] link beside the owner name to enable the user to change the record owner.
 
Code:
 
<apex:outputfield value="{!Project__c.OwnerID}" />
 
Can anyone help? Thanks!
 
  • August 28, 2008
  • Like
  • 0
Hi
 
We are two friends doing freelance sfdc s-control developments during weekend.
 
We are having multiple years of programming experience(over 10 years) and more than an year's expeirence on SFDC-Implementations and S-Controls.
 
We have implemented S-Controls for large clients(using AJAX Toolkit) and one of us had been a consultant to Salesforce professional Servies Team.
 
We have expertise on uploading data from Exel Sheets to SFDC. We can fix bugs in any of the existing S-Controls and enhance them.
 
We can develop s-controls for your requirements at a cheaper price. If you are interested please reply back.
 
Thanks
Jay & Tesh
  • September 08, 2006
  • Like
  • 0