• dev33
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Controller

System.debug('opportunityLineItems ------------------'+opportunityLineItems);
for(OpportunityLineItem opportunityLineItem:opportunityLineItems){
System.debug('opportunityLineItem------------------'+opportunityLineItem);
System.debug('PricebookEntryId------------------'+opportunityLineItem.PricebookEntryId);
System.debug('PricebookEntry Name------------------'+opportunityLineItem.PricebookEntry.Name);

}

 

VF

<apex:pageBlockTable value="{!OpportunityLineItems}" var="item" headerClass="headerRow" rowClasses="odd even">
<apex:column value="{!item.PricebookEntry.Name}" headerClass="headerRow" headerValue="Deal Products" />
<apex:column value="{!item.PricebookEntry.ProductCode}" headerClass="headerRow" headerValue="Part Number" />
<apex:column headerClass="headerRow" headerValue="QTY" value="{!item.Quantity}"/>
<apex:column headerClass="headerRow" headerValue="MSRP" value="{!item.ListPrice}" />
</apex:pageBlockTable>

  • April 21, 2011
  • Like
  • 0

I have a scenario where

1) A visualforce page shows a list of records of a custom object named YAccount.

2) When I click on any of these record's names, a new vf page opens up with the details of that record and a related list called Orders with all the records in it.

 

       Now If I use the standard <apex:relatedlist> tag to display this "Orders" related list, it has a new order button and clicking it would take me to a new page to add a new record to the Orders.

 

The requirement is to be able to add a new record in the same page at the end of the table that's showing the list of Orders related to that particular YAccount.

 

Any suggestions on this are appreciated.

Thanks.

  • April 01, 2011
  • Like
  • 0

I am trying to create customer portal with a custom login page. I am using Sites to do this. How can I assign custom login page other than the standard one provided by salesforce?

  • March 17, 2011
  • Like
  • 0

I'm just starting out in SF, and don't have a lot of development experience. We have a customer portal that was recently developed, and I need to tweak it a bit to output the current user's main account name in the header of the portal. As far as I can tell I can only upload a static HTML file via the Documents section of our instance. Is that correct? How would I pull in a dynamic value to that section of our portal?

  • July 28, 2010
  • Like
  • 0

Hello,

I have done a fair amount of research on this topic, but I am still unclear on how to accomplish the following two things:

1. We are using Salesforce's Customer Portal product. We have built two custom objects and are displaying tabs for these custom objects in our Customer Portal. We have also built controller extensions for these custom objects to extend the functionality of the standard controllers. We want to display Visualforce pages when a user clicks on the tabs for these objects in the Customer Portal. In order to override the tabs for these objects with a Visualforce page, we cannot specify a standardContoller using the same object name in the Visualforce page. If we do, the VF page is not given as an option when you try to override the tab. If the VF page does not have a standardController specified, we can use it to override the tab, but we cannot link our controller extension to the page.

For example, I have a custom object called "Contact Us". I want to override the tab for this object with the following Visualforce page:

Code:
<apex:page standardController="Contact_Us__c" extensions="ContactUsExtensions">
  <h1>Custom Contact Us Page</h1>
</apex:page>

I am not given the option to override the "Contact Us" custom object tab with this page. It will only allow me to override it with a page that does not have a standardController specified. Why is that?

2. In addition to above, we need to show the standard "Contact Us" homepage when a user clicks on the "Contact Us" tab in the regular Salesforce interface, and we need to show a custom Visualforce page when a user clicks on the "Contact Us" tab in the Customer Portal. To do this, we created a new controller, ContactOverride - here is the code:

Code:
public class ContactOverride {
    public ContactOverride() {

    }


   String recordId;

public ContactOverride(ApexPages.StandardController
       controller) {recordId = controller.getId();}

public PageReference redirect() {
  Profile p = [select name from Profile where id =
               :UserInfo.getProfileId()];
  if ('Customer Portal User'.equals(p.name)
      || 'Customer Portal Test'.equals(p.name))
      {
       PageReference customPage =
Page.PortalContactUs;
       customPage.setRedirect(true);
       customPage.getParameters().put('id', recordId);
       return customPage;
      } else {
         return null; //otherwise stay on the same page
      }
   }
}

This code was lifted directly from the Force.com Cookbook (pages 53-56) and modified slightly to fit our needs. Basically, the controller sends users in the profiles "Customer Portal User" or "Customer Portal Test" to a custom Visualforce page (PortalContactUs) when they click on the "Contact Us" tab. If the user is not in either of those profiles, they stay on the same page.

Then, we created a new Visualforce page called ContactRedirect that looks like this:

Code:
<apex:page controller="ContactOverride" action="{!redirect}">
   <apex:detail />
</apex:page>

and override the tab on the "Contact Us" custom object with this page.

Again, we took this code from the Force.com Cookbook (pages 53-56) and modified it slightly. (The instructions in the Cookbook tell us to set a standardController and use the override controller we built as an extension. However, we cannot override the tab with a standardController set as explained in issue 1.)

This seems to work, but we would prefer that users who are not in the "Customer Portal User" or "Customer Portal Test" profiles see the standard "Contact Us" homepage under the "Contact Us" tab, and not the "ContactRedirect" VF page. Is there a way to change the controller (ContactOverride) to do this?

What are the best solutions to these issues?

Thanks for any help that you can offer,

-- Robert