I am trying to display picklist values from a multi select picklist from a related object. I am using a visualforce page and putting this in the record detail.
VF Code:
<apex:page showHeader="false" standardController="ElementsController" > sidebar="false" standardstylesheets="true">
<apex:pageBlock title="Elements within the Material">
<apex:outputLabel title="Elements"></apex:outputLabel>
<apex:actionRegion >
<apex:pageBlockSection id="Materials" title="Element Information">
<apex:actionSupport event="onchange" action="{!ElementsConroller}" rerender="Materials, msgs"/>
<apex:outputField value="{!Requirement__c.Material__c.Elements_within_the_material__c}"/>
</apex:pageBlockSection>
</apex:actionRegion>
</apex:pageBlock>
</apex:page>
Controller:
public with sharing class ElementsController {
private ApexPages.StandardController stdCtrl;
public ElementsController(ApexPages.StandardController std)
{
stdCtrl=std;
}
public void MaterialPopulate()
{
Requirement__c Mat=(Requirement__c) stdCtrl.getRecord();
Mat.Material__c=[select Material__c.Elements_within_the_material__c, Materials from Requirement__c where id=:Mat.Id];
}
}
I am getting the following error:
Didn't understand relationship 'Material__c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.
That error is from the controller. When i append the __r for the reference I get the following error:
Code change:
public void MaterialPopulate()
{
Requirement__c Mat=(Requirement__c) stdCtrl.getRecord();
// code changed HERE
Mat.Material__c=[select Material__r.Elements_within_the_material__c, Materials from Re
quirement__c where id=:Mat.Id];
}
}
No such column 'Materials' on entity 'Requirement__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Can anyone help me out?