You need to sign in to do that
Don't have an account?

Show information from related object in VisualForce
Hi all. Im creating a wizard with VisualForce were, to put an example, I'm populating information from a Customer and the product it bought. So, in the first step we load the information related to the Customer (Customer__c), in the second page we load the information for each of the product he/she bought (Product__c), and in the third page I want to show the summary of all this steps.
So, my problem comes at this step, were I want to show, for each of the products, the Product Type (Product_Type__c) they belong to (information that was loaded though a lookup in the step 2).
so, the Visualforce code that I'm trying to use is:
<apex:repeat value="{!products}" var="item">
<apex:outputText value="Article Number"/>
<apex:outputText value="{!item.Article_Number__c}"/>
<apex:outputText value="Product Type"/>
<apex:outputText value="{!item.Product_Type__c.Name}"/>
</apex:repeat>
When trying to save this I get: Error: Unknown property 'String.Name'
When I remove the .Name, what I'm showing is the Id of the Product_Type__c chosen.
So, how can I iterate through the list of product and for each of it show the Product_Type__c.Name ?
Thank you in advance!
So, my problem comes at this step, were I want to show, for each of the products, the Product Type (Product_Type__c) they belong to (information that was loaded though a lookup in the step 2).
so, the Visualforce code that I'm trying to use is:
<apex:repeat value="{!products}" var="item">
<apex:outputText value="Article Number"/>
<apex:outputText value="{!item.Article_Number__c}"/>
<apex:outputText value="Product Type"/>
<apex:outputText value="{!item.Product_Type__c.Name}"/>
</apex:repeat>
When trying to save this I get: Error: Unknown property 'String.Name'
When I remove the .Name, what I'm showing is the Id of the Product_Type__c chosen.
So, how can I iterate through the list of product and for each of it show the Product_Type__c.Name ?
Thank you in advance!
note the r tells salesforce it's a related name.
thx
dan
this might help:
https://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_transaction_control.htm