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

Visualforce page: Error: Unknown property 'Opportunity_Positioning__cStandardController.Buying_Influence__c'
Hi everyone,
I'm getting -Error: Unknown property 'Opportunity_Positioning__cStandardController.Buying_Influence__c'?
Any ideas what I am doing wrong? Your assistance would be much appreciated!
Thank you,
Rog
<apex:page standardcontroller="Opportunity_Positioning__c">
extensions="EditableBuyingInfluenceExtension"
<apex:sectionheader title="{!$ObjectType.Buying_Influence__c.label} Edit" subtitle="{!IF(ISNULL(Buying_Influence__c.Name), 'New Buying Influence',Buying_Influence__c.Name)}"/>
<apex:form >
<apex:pageblock mode="edit" title="{!$ObjectType.Buying_Influence__c.label} Edit">
<apex:pageblockbuttons >
<apex:commandbutton value="Save" action="{!Save}"/>
<apex:commandbutton value="Cancel" action="{!Cancel}"/>
</apex:pageblockbuttons>
<apex:pageblocksection title="Information" showheader="true" columns="2">
<apex:outputText> value="{!Opportunity_Positioning__c.Name}"/>
<apex:outputText> value="{!Opportunity_Positioning__c.Opportunity__c}"/>
<apex:pageblocksectionitem />
<apex:pageBlockSectionItem >
<apex:pageblocksection id="childList" columns="1" title="Buying Influence" collapsible="false">
<apex:variable var="rowNum" value="{!ZERO}" />
<apex:outputLabel value="No Buying Influence currently exist. Click below to Add." rendered="{!NOT(hasChildren)}"/>
<apex:pageBlockTable value="{!children}" var="Buying Influence" rendered="{!hasChildren}">
<apex:column headerValue= "Buying Influence">
<apex:inputfield value="{!Buying_Influence__c.Name}" required="true"/>
<apex:column headerValue= "SCOP">
<apex:inputfield value="{!Buying_Influence__c.SCOP__c}" required="true"/>
<apex:column headerValue= "Influencer Name">
<apex:inputfield value="{!Buying_Influence__c.Influencer_Name__c}" required="true"/>
<apex:column headerValue= "Buying Influence role">
<apex:inputfield value="{!Buying_Influence__c.Buying_influence_role__c}" required="true"/>
<apex:column headerValue= "Degree of Influence">
<apex:inputfield value="{!Buying_Influence__c.Degree_of_Influence__c}" required="true"/>
<apex:pageblocksectionitem />
</apex:column>
<apex:pageblocksection title="How well is based covered for this contact" showheader="true" columns="2">
</apex:pageblocksection>
</apex:column> headerValue="Rating for base covered">
<apex:inputfield value="{!Buying_Influence__c.Rating_for_base_covered__c}" required="true"/>
</apex:column> headerValue="Equivalent Collinson Stakeholder">
<apex:inputfield value="{!Buying_Influence__c.Equivalent_Collinson_Stakeholder__c}" required="false"/>
</apex:column> headerValue="Evidence to support your rating">
<apex:inputfield value="{!Buying_Influence__c.Evidence_to_support_your_rating__c}" required="false"/>
</apex:column>
<apex:column headerValue=" ">
<!-- This is the second half of the trick to keep track
of your row index for deletion. -->
<apex:variable var="rowNum" value="{!rowNum + 1}" />
<apex:commandLink value="Delete" action="{!removeFromList}" rerender="childList,messages" immediate="true">
<apex:param name="removeIndex" assignTo="{!removeIndex}" value="{!rowNum}" />
</apex:commandLink>
</apex:column>
</apex:pageBlockTable>
<apex:commandButton value="Add Buying Influence" action="{!addToList}" rerender="childList, messages" immediate="true" />
</apex:pageBlockSection>
</apex:pageblocksectionitem>
</apex:outputtext> </apex:outputtext>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
I'm getting -Error: Unknown property 'Opportunity_Positioning__cStandardController.Buying_Influence__c'?
Any ideas what I am doing wrong? Your assistance would be much appreciated!
Thank you,
Rog
<apex:page standardcontroller="Opportunity_Positioning__c">
extensions="EditableBuyingInfluenceExtension"
<apex:sectionheader title="{!$ObjectType.Buying_Influence__c.label} Edit" subtitle="{!IF(ISNULL(Buying_Influence__c.Name), 'New Buying Influence',Buying_Influence__c.Name)}"/>
<apex:form >
<apex:pageblock mode="edit" title="{!$ObjectType.Buying_Influence__c.label} Edit">
<apex:pageblockbuttons >
<apex:commandbutton value="Save" action="{!Save}"/>
<apex:commandbutton value="Cancel" action="{!Cancel}"/>
</apex:pageblockbuttons>
<apex:pageblocksection title="Information" showheader="true" columns="2">
<apex:outputText> value="{!Opportunity_Positioning__c.Name}"/>
<apex:outputText> value="{!Opportunity_Positioning__c.Opportunity__c}"/>
<apex:pageblocksectionitem />
<apex:pageBlockSectionItem >
<apex:pageblocksection id="childList" columns="1" title="Buying Influence" collapsible="false">
<apex:variable var="rowNum" value="{!ZERO}" />
<apex:outputLabel value="No Buying Influence currently exist. Click below to Add." rendered="{!NOT(hasChildren)}"/>
<apex:pageBlockTable value="{!children}" var="Buying Influence" rendered="{!hasChildren}">
<apex:column headerValue= "Buying Influence">
<apex:inputfield value="{!Buying_Influence__c.Name}" required="true"/>
<apex:column headerValue= "SCOP">
<apex:inputfield value="{!Buying_Influence__c.SCOP__c}" required="true"/>
<apex:column headerValue= "Influencer Name">
<apex:inputfield value="{!Buying_Influence__c.Influencer_Name__c}" required="true"/>
<apex:column headerValue= "Buying Influence role">
<apex:inputfield value="{!Buying_Influence__c.Buying_influence_role__c}" required="true"/>
<apex:column headerValue= "Degree of Influence">
<apex:inputfield value="{!Buying_Influence__c.Degree_of_Influence__c}" required="true"/>
<apex:pageblocksectionitem />
</apex:column>
<apex:pageblocksection title="How well is based covered for this contact" showheader="true" columns="2">
</apex:pageblocksection>
</apex:column> headerValue="Rating for base covered">
<apex:inputfield value="{!Buying_Influence__c.Rating_for_base_covered__c}" required="true"/>
</apex:column> headerValue="Equivalent Collinson Stakeholder">
<apex:inputfield value="{!Buying_Influence__c.Equivalent_Collinson_Stakeholder__c}" required="false"/>
</apex:column> headerValue="Evidence to support your rating">
<apex:inputfield value="{!Buying_Influence__c.Evidence_to_support_your_rating__c}" required="false"/>
</apex:column>
<apex:column headerValue=" ">
<!-- This is the second half of the trick to keep track
of your row index for deletion. -->
<apex:variable var="rowNum" value="{!rowNum + 1}" />
<apex:commandLink value="Delete" action="{!removeFromList}" rerender="childList,messages" immediate="true">
<apex:param name="removeIndex" assignTo="{!removeIndex}" value="{!rowNum}" />
</apex:commandLink>
</apex:column>
</apex:pageBlockTable>
<apex:commandButton value="Add Buying Influence" action="{!addToList}" rerender="childList, messages" immediate="true" />
</apex:pageBlockSection>
</apex:pageblocksectionitem>
</apex:outputtext> </apex:outputtext>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
try this
Thanks
All Answers
You are refering Buying_Influence__c in VF page.But it is not a standard controller and possibly not declared in extension.Thats why you are getting that error.
Thanks.
Mark it as solved rog.
Thanks
I'm still getting stuck.
Now I am getting this error message when creating on of the classes: Error: Compile Error: Non-void method might not return a value or might have statement after a return statement. at line 19 column 36
public class addOpportunityPositioningExt{
public Opportunity_Positioning__c dem {get; set;}
public addOpportunityPositioningExt(ApexPages.StandardController stdController) {
dem= (Opportunity_Positioning__c)stdController.getRecord();
}
public PageReference saveDem(){
try{
upsert dem;
PageReference pageRef = new PageReference('/apex/addBuyingInfluences?id=' + dem.Id + '&retUrl=' + dem.Id);
pageRef.setRedirect(true);
return pageRef;
}catch(DMLException saveEx){
//handle exception
}
}
}
try this
Thanks
Thank you so much! It looks like it's working.
If you don't mind could you help me identify what's wrong with this one:
Error: Compile Error: Didn't understand relationship 'Buying_Influence__r' 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. at line 11 column 19
public with sharing class EditableBuyingInfluenceExtension extends EditableBuyingInfluenceList
{
public Opportunity_Positioning__c mydemo {get; private set;}
public List<Quota__c> children {get; set;}
public EditableBuyingInfluenceListExtension(ApexPages.StandardController stdController)
{
super(stdController);
this.mydemo = [SELECT Id,
Name,
Buying_Influence__r.Name
FROM Opportunity_Positioning__c
WHERE Id =: stdController.getRecord().Id];
this.childList = [SELECT Id,
Buying_Influence__c.Name,
Buying_Influence__c.SCOP__c,
Buying_Influence__c.Influencer_Name__c,
Buying_Influence__c.Buying_influence_role__c,
Buying_Influence__c.Degree_of_Influence__c,
Buying_Influence__c.Rating_for_base_covered__c,
Buying_Influence__c.Equivalent_Collinson_Stakeholder__c
Buying_Influence__c.Evidence_to_support_your_rating__c
FROM Buying_Influence__c
WHERE Opportunity_Positioning__c =: mysObject.Id];
children = new List<Buying_Influence__c>();
children.addALL(this.childList);
}
/*
* This method is necessary for reference on the Visualforce page,
* in order to reference non-standard fields.
*/
/*public List<Quota__c> getChildren()
{
return (List<Quota__c>)childList;
}*/
public PageReference saveChildren(){
try{
upsert children;
//use the redirect method like the demographic page if needed after upsert
}catch(DMLException saveEx){
//do something
}
return null;
}
public override sObject initChildRecord()
{
Buying_Influence__c child = new Buying_Influence__c();
child.Opportunity_Positioning__c = mydemo.Id;
return child;
}
}
Buying_Influence__c is child to Opportunity_Positioning__c or parent?
if it is child Opportunity_Positioning__c modify your query like this
Let me know if you have any issues.
Thanks.
Error: Compile Error: Didn't understand relationship 'Buying_Influence__r' in FROM part of query call. 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. at line 11 column 19
Buying Influence Page
Please try this code. If this didn't work please share previous copy of your code and snapshot of Buying_Influence__c field(Look up field info) definition.
Thanks.
Error: Compile Error: Didn't understand relationship 'Buying_Influence__r' in FROM part of query call. 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. at line 11 column 19
I want the relationship field which connects Buying_Influence__C and Opportunity_Positioning__c.If there is no relationship between these two objects create lookup or master-detail based on your requirement on Buying_Influence__C.
Thanks.
Try this once then
Thanks.
Opportunity Positioning
Singular Label: Strategic Client Opportunity
Plural Label: SCOP
Object Name: Opportunity_Positioning
API Name: Opportunity_Positioning__c
Buying Influence
Singular Label; Buying Influence
Plural Label; Buying Influences
Object Name; Buying_Influence
API Name; Buying_Influence__c
Share screenshot of The lookup field on the Buying Influence is called SCOP__c.
Create->Objects->Buying_Influence__c
under Buying_Influence__c click on field called SCOP__C and share that screen shot here.
Please refer to this link you will get to know how to use the relationship names in SOQL query.
https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_relationships_and_custom_objects.htm#sforce_api_calls_soql_relationships_and_custom_objects
Thanks.
http://www.sfdc99.com/2013/06/24/example-how-to-write-a-cross-object-soql-query-part-2/
Thanks.
Error: Compile Error: unexpected token: 'FROM' at line 25 column 22
So sorry. ;-(
no Problem.Try above code.
Thanks.
Solved.