-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
4Questions
-
9Replies
Visual Force compile problem Error: Invalid field Contract_item__c for SObject Account
I need help to resolve this page . I want to display the line items of a contract, which reside on a custom object names Contract Item, on the account record page. The Contract Item is a child of the Standard contracts object and has a lookup relationship to the account. I took the code sample from the VF dev guide for the account contact example and modified it to my needs but cannot get it to complile I get the follwing error: Error: Invalid field Contract_item__c for SObject Account
I have tried using the contract_item, contract_item__c for the value parameter on the pageblock table and get this error every way I have tried.
The idea is to have the items show on the account pagelayout as a VF for user convenience. I do not need to show the contract parent here, it is fine as a related liet, but the items I need to show withint the acct header layout. Any help is greatly appreciated as my VF skills are limited.
Here is the code:
<apex:page standardController="Account"> <apex:pageBlock title="Contract Item Viewer!"> Contract Items for the {!account.name} account. </apex:pageBlock> <apex:pageBlock title="Contract Item Viewer"> <apex:pageBlockTable value="{!account.Contract_item__c}" var="items"> <apex:column value="{!items.Negotiation_Type__c}"/> <apex:column value="{!items.Discount_Type__c}"/> <apex:column value="{!items.Discount_Percent__c}"/> <apex:column value="{!items.Amount__c}"/> <apex:column value="{!items.Page__c}"/> <apex:column value="{!items.Day_of_Week__c}"/> <apex:column value="{!items.Right_Location__c}"/> <apex:column value="{!items.Section_Description__c}"/> <apex:column value="{!items.Position_Description__c}"/> <apex:column value="{!items.Contract__c}"/> <apex:column value="{!items.Ad_Unit__c}"/> <apex:column value="{!items.Special_Terms__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
Tks,
Quique
- Quiquepr
- June 22, 2012
- Like
- 0
- Continue reading or reply
problem with custom button retURL behavior...does not return to source record
I have created a custom button to create a new record in custom object from the case detail screen. The relative URL also passes several case field values mapped to the custom object fields and then i close the url with the returl of the case.id to return the user to the originating case screen. When i press save on the new custom object record, it return to the detail view of the just created custom object record and not the case, but If I cancel it responds correctly and returns to the case detail view ...any ideas? I have done this many times in the past and has worked flawlessly.
here is the button definition: name : Create TREQ Display Type: displ in existing window w/out sidebar or header Content Source: URL a0P is the custom object (in this case a training request) that is based on the case but requires a separate record. The other are the custom fields mapped - they do map correctly and show correctly ion the new record screen of the training request object. The only issue is upon save it does not return to the to case. I have place the button on the training request related list and onthe case detail button and still get the same results. never had this happen before. Button Code: /a0P/e?CF00NA0000009MPqF={!Case.CaseNumber}
&CF00NA0000009MPqF_lkid={!Case.Id}
&CF00NA0000009MPqh={!Case.Account}
&CF00NA0000009MPqh_lkid={!Case.AccountId}
&00NA0000009U0wH={!Case.Category_Type__c}
&retURL=%2f{!Case.Id}
I have tried the various options of the display beahvior to no avail. I have use the / or the encoded %2f as substitute for the backslash and still no success... any help is rgeatly appreciated. Tks, Quique |
- Quiquepr
- August 03, 2011
- Like
- 0
- Continue reading or reply
List Button problem creating new opportunities from custom object getting error on literal string
Hello:
I am creating a list button to mass create new opportuies based on records from a custom object. I am in a bind to get this into production early next week and would appreciate the communities help...
We have a policy sales record (PSR) custom object and need to create renewal opportunities from selected records in a policy sales record list view. I have very little Javascript knowledge but using several postings from the boards & blogs I came up with the following code that throws the following error after selecting the policies in the view and clicking on the button to execute.
When clicking onthe button we want to create new opportunities of a specific record type and prepopulate sevaral key records from the values on the policy sales record.
Here is the code for my button:
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} //adds the proper code for inclusion of AJAX toolkit var url = parent.location.href; //string for the URL of the current page var records = {!GETRECORDIDS($ObjectType.Policy_Sales_Record__c)}; //grabs the Policy Sales Records records that the user is requesting to update var CreateNewRecords = []; //array for holding records that this code will ultimately update if (records[0] == null) { //if the button was clicked but there was no record selected alert("Please select at least one record to update."); //alert the user that they didn't make a selection } else { //otherwise, there was a record selection for (var a=0; a<records.length; a++) { //for all records var create_new_opportunity = new sforce.SObject("opportunity"); //create a new sObject for storing updated record details create_new_opportunity.RecordTypeId = "012A0000000R4UX"; //set the record type to Renewal Opportunities create_new_opportunity.AccountId = "{!Policy_Sales_Record__c.Account__c}"; //set the account ID value from PSR create_new_opportunity.Closedate = "{!Policy_Sales_Record__c.Policy_Renewal_Date__c}"; //set the value for renewal date from policy data create_new_opportunity.OwnerId = "{!Policy_Sales_Record__c.Account_Owner__c}"; //set the value for account owner create_new_opportunity.Primary_Producer__c = "{!Policy_Sales_Record__c.Producer__c}"; //set the value for the producer create_new_opportunity.Renewal_Base_Premium__c = "{!Policy_Sales_Record__c.Renewal_Base_Premium__c}" create_new_opportunity.Renewal_Base_No_of_Contracts__c = {!Policy_Sales_Record__c.Renewal_Base_No_of_Contracts__c}"; CreateNewRecords.push(create_new_opportunity); //add the updated record to our array } result = sforce.connection.insert(CreateNewRecords); //insert new records into to Salesforce parent.location.href = url; //refresh the page }
Regards and thanks in advance
Quique
- Quiquepr
- December 03, 2010
- Like
- 0
- Continue reading or reply
Data in table working fine in VisualForce page, NOT showing in sites
I have a simple page to display our customer references on our web site via sites. I chek the page within salesforce and renders just fine, but when I go through sites, only the table column headers show and no data on the table.
The fields are based on account object and also have a puyblish fla field. Also the logo url field presents the location of the logo. All the logos are in customer logo folder under the documents tabs and all have a external view value of true. Security is public read write.
I have granted read access on the site publi settgins to the guest profile for the specfific site.
Any ideas anyone?
Here is the page
<apex:page controller="ValueCustomerListing" showHeader="false" cache="true" expires="0">
<site:googleAnalyticsTracking />
<apex:image url="http://tvmcompany.com/images/logo.gif" />
<br/>
<apex:dataTable value="{!accounts}" var="account" id="thelist" rowClasses="odd,even"
styleClass="tableClass" cellpadding="5" cellspacing="4">
<apex:column >
<apex:image alt="Logo Not Available" width="125" url="{!account.Logo_Location__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Organization</apex:facet>
<apex:outputText style="center" value="{!account.name}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Industry</apex:facet>
<apex:outputText style="center" value="{!account.industry}"/>
</apex:column>
</apex:dataTable>
</apex:page>
Here is the controller
public with sharing class ValueCustomerListing {
List<Account> accounts;
public List<Account> getAccounts(){
accounts = [select name, industry, logo_location__c from account WHERE valuecloud_publish__c = TRUE ORDER BY Name];
return accounts;
}
}
When accessed via sites, this page only renders the following (no data table....)
Organization | Industry |
---|
This the sfdc internal page (but is shows the logos.)
Organization | Industry | |
---|---|---|
Centennial Communications de Puerto Rico | Telecommunications & Technology | |
Fideicomiso de Conservacion de Puerto Rico | Environmental | |
Humano ARS | Finance, Insurance, Real Estate | |
Liberty Cablevision Puerto Rico | Telecommunications & Technology | |
Sistema de Retiro de Maestros | Public Sector | |
The Value Management Company | Consulting | |
Wireless Idea | Enterntainment | |
WorldNet Telecommunications | Telecommunications & Technology |
- Quiquepr
- December 29, 2010
- Like
- 0
- Continue reading or reply
List Button problem creating new opportunities from custom object getting error on literal string
Hello:
I am creating a list button to mass create new opportuies based on records from a custom object. I am in a bind to get this into production early next week and would appreciate the communities help...
We have a policy sales record (PSR) custom object and need to create renewal opportunities from selected records in a policy sales record list view. I have very little Javascript knowledge but using several postings from the boards & blogs I came up with the following code that throws the following error after selecting the policies in the view and clicking on the button to execute.
When clicking onthe button we want to create new opportunities of a specific record type and prepopulate sevaral key records from the values on the policy sales record.
Here is the code for my button:
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} //adds the proper code for inclusion of AJAX toolkit var url = parent.location.href; //string for the URL of the current page var records = {!GETRECORDIDS($ObjectType.Policy_Sales_Record__c)}; //grabs the Policy Sales Records records that the user is requesting to update var CreateNewRecords = []; //array for holding records that this code will ultimately update if (records[0] == null) { //if the button was clicked but there was no record selected alert("Please select at least one record to update."); //alert the user that they didn't make a selection } else { //otherwise, there was a record selection for (var a=0; a<records.length; a++) { //for all records var create_new_opportunity = new sforce.SObject("opportunity"); //create a new sObject for storing updated record details create_new_opportunity.RecordTypeId = "012A0000000R4UX"; //set the record type to Renewal Opportunities create_new_opportunity.AccountId = "{!Policy_Sales_Record__c.Account__c}"; //set the account ID value from PSR create_new_opportunity.Closedate = "{!Policy_Sales_Record__c.Policy_Renewal_Date__c}"; //set the value for renewal date from policy data create_new_opportunity.OwnerId = "{!Policy_Sales_Record__c.Account_Owner__c}"; //set the value for account owner create_new_opportunity.Primary_Producer__c = "{!Policy_Sales_Record__c.Producer__c}"; //set the value for the producer create_new_opportunity.Renewal_Base_Premium__c = "{!Policy_Sales_Record__c.Renewal_Base_Premium__c}" create_new_opportunity.Renewal_Base_No_of_Contracts__c = {!Policy_Sales_Record__c.Renewal_Base_No_of_Contracts__c}"; CreateNewRecords.push(create_new_opportunity); //add the updated record to our array } result = sforce.connection.insert(CreateNewRecords); //insert new records into to Salesforce parent.location.href = url; //refresh the page }
Regards and thanks in advance
Quique
- Quiquepr
- December 03, 2010
- Like
- 0
- Continue reading or reply
Printable View on visual force page
I am trying to put Printable View option on a VF page and I am using PrintUrl attribute in Apex:sectionheader tag. my code is similar to this. but if I click on the Printable View the popup window is not coming in the same format as we get for standard pages. Is there any working around or am I missing something. Please help me. Thanks in advance.
PK
<apex:sectionHeader title="Page Title" printUrl="/apex/SamplePage?Id={!companyId}"/>
- sfdeveloper9
- September 22, 2010
- Like
- 0
- Continue reading or reply
Opportunities without Opportunity Partner related records?
Hi,
I have been charged with creating a report that displays only opportunities that do not have opportunity partner related records; however, I do not see the Opportunity Partner related table as an option when creating custom report types and I do not see how custom report types allow you to create a type that returns only records in the parent that have no children?
Is there a way to do this in a simple report? If it is not then how can I create a SOQL that can do it? If I have a SOQL that can do it I can use it in code to populate a custom table then use that custom table in a report?
Any ideas?
- Eager-2-Learn
- June 07, 2010
- Like
- 0
- Continue reading or reply
Help needed: custom button to fire email template and update status
Hello all,
Long time lurker, first time poster. I'm trying to create a custom button for my lead view that will:
1. Fire an email template to a lead
2. Update a status field
3. Return the user to the lead view
Here's what I've got so far - it fires the template but does NOT update the status. Can someone point me in the right direction?
location.replace('/email/author/emailauthor.jsp?p2_lkid={!Lead.Id}&retURL=%2F{!Lead.Id}&template_id=00X40000001B4fY&{!URLFOR($Action.Lead.Edit, Lead.Id, [retURL=URLFOR($Action.Lead.View, Lead.Id), lea13_ileinner ="First email and call attempt made", save=1] )}')
Much appreciated!
- Christopher Penn
- June 02, 2010
- Like
- 0
- Continue reading or reply
Data in table working fine in VisualForce page, NOT showing in sites
I have a simple page to display our customer references on our web site via sites. I chek the page within salesforce and renders just fine, but when I go through sites, only the table column headers show and no data on the table.
The fields are based on account object and also have a puyblish fla field. Also the logo url field presents the location of the logo. All the logos are in customer logo folder under the documents tabs and all have a external view value of true. Security is public read write.
I have granted read access on the site publi settgins to the guest profile for the specfific site.
Any ideas anyone?
Here is the page
<apex:page controller="ValueCustomerListing" showHeader="false" cache="true" expires="0">
<site:googleAnalyticsTracking />
<apex:image url="http://tvmcompany.com/images/logo.gif" />
<br/>
<apex:dataTable value="{!accounts}" var="account" id="thelist" rowClasses="odd,even"
styleClass="tableClass" cellpadding="5" cellspacing="4">
<apex:column >
<apex:image alt="Logo Not Available" width="125" url="{!account.Logo_Location__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Organization</apex:facet>
<apex:outputText style="center" value="{!account.name}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Industry</apex:facet>
<apex:outputText style="center" value="{!account.industry}"/>
</apex:column>
</apex:dataTable>
</apex:page>
Here is the controller
public with sharing class ValueCustomerListing {
List<Account> accounts;
public List<Account> getAccounts(){
accounts = [select name, industry, logo_location__c from account WHERE valuecloud_publish__c = TRUE ORDER BY Name];
return accounts;
}
}
When accessed via sites, this page only renders the following (no data table....)
Organization | Industry |
---|
This the sfdc internal page (but is shows the logos.)
Organization | Industry | |
---|---|---|
Centennial Communications de Puerto Rico | Telecommunications & Technology | |
Fideicomiso de Conservacion de Puerto Rico | Environmental | |
Humano ARS | Finance, Insurance, Real Estate | |
Liberty Cablevision Puerto Rico | Telecommunications & Technology | |
Sistema de Retiro de Maestros | Public Sector | |
The Value Management Company | Consulting | |
Wireless Idea | Enterntainment | |
WorldNet Telecommunications | Telecommunications & Technology |
- Quiquepr
- December 29, 2010
- Like
- 0
- Continue reading or reply
CMSForce - deploying a BlankTemplate page with a custom VF Page
I am trying to create a page using the BlankTemplate based on a VF page I created with a custom controller using CMSForce. I have read and re-read the documention and can't seem to get it to work in sandbox or production. The page I created is below. What am I missing? Thank you for your help!
<apex:page controller="CourseList">
<apex:pageBlock >
<apex:dataTable value="{!Courses}" var="CourseList" width="100%" >
<apex:column >
<apex:facet name="header"><b>Class Name</b></apex:facet>
{!CourseList.Name}
</apex:column>
<apex:column >
<apex:facet name="header"><b>Class Description</b></apex:facet>
{!CourseList.Description_Short__c}
</apex:column>
<apex:column >
<apex:facet name="header"><b>Date of Class</b></apex:facet>
{!CourseList.Date_of_Class__c}
</apex:column>
<apex:column >
<apex:facet name="header"><b>Class Location</b></apex:facet>
{!CourseList.Class_Venue__r.Name}
</apex:column>
</apex:dataTable>
</apex:pageBlock>
</apex:page>
- iKnowledge
- October 27, 2009
- Like
- 0
- Continue reading or reply
VisualForce & Home Page Component Problems
Hopefully I'm missing something really simple here. I created a "Home Page Component" with the following body:
<iframe src="/apex/test" width="100%" frameborder="0" height="100"></iframe>
Where "test" is my VisualForce page. When I configure this to display on my home page, I see the source code as opposed to my VF page? Any help is greatly appreciated!
Regards
- Thomas Stroh
- August 12, 2009
- Like
- 0
- Continue reading or reply
Calculated Opp Amount with Professional Edition?
- D. Pellegrini
- September 19, 2008
- Like
- 0
- Continue reading or reply