• Qin Lu
  • NEWBIE
  • 65 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 4
    Replies
I have a visual force page using angular JS. I have include this page as a section in Contact standard page.  I need to create a drill down for one of the field to naviage a standard detail page. I understand how to do this in visual force page using outputlink. But my page is using Angular JS, 
If I do the following

<div  class="card"  ng-repeat="story in stories">
      <a id="link-3" ng-href = "/{{story.Id}}">{{story.title}}</a>
</div>

it opens the iframe in current section. 

If I use do the following as I used in outputlink


<a id="link-3" ng-href ="window.top.location.href ='/{{story.Id}}'">{{story.title}}</a>
or
<a id="link-3" ng-click ="window.top.location.href ='/{{story.Id}}'">{{story.title}}</a>
neither one is working at all. I can see story.Id is resolved correctly when I inspect element in browser. 

Any help is appreciated !
  • August 30, 2014
  • Like
  • 0
I have a visual force page embedded in Contact detail page layout. I have a output link to drill down to detail custom object page. I have the following in my page, and it drill down correctly to detail custom object page, but it doesn't work when do right click Open in New Tab, I got 
URL No Longer Exists error

<apex:outputLink onClick="window.top.location.href = '{!redirectUrl}';">{!fa[field]}
</apex:outputLink>

How to make the output link work for both drill down in the same window as well as Open in New Tab?

Thanks
  • August 03, 2014
  • Like
  • 1
I have created a custom object called Hobbies, and it is a child of Contact object (master/detail). I want to filter contact based on the value in this child object. 
Say
Contact: Name= John Smith
Hobbies: name=Tennis, name=Shopping

Contact: Joan Doe
Hobbies: name=Reading, name=Shopping

Can I add a filter crtieria to the standard Contact Create New View page to create a new contact list based on the Hobbies object?
If not, can I add a custom button to filter the contact list based on the custom object Hobbies?
I tried to enable tags, I go to Customize -> Tags, I can only see Enable Personal Tags checkbox, but I don't see Enable Public Tags checkbox. Is there another setup to enable Enable Public Tags?
I have a page using apex:repeat to generate the content dynamically.  The page code is like the following
<apex:pageBlock >
  <apex:repeat value="{!Categories}" var="category">
     <apex:pageBlockSection title="{!category}" columns="1">
         <apex:pageBlockTable value="{!AcctListByCategory[category]}" var="fa"  title="category">
            <apex:repeat value="{!fieldListByCategory[category]}" var="field">
                   <apex:column value="{!fa[field]}" >
                   </apex:column>  
            </apex:repeat>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
  </apex:repeat>
</apex:pageBlock>

Because each category the number of fields are different, some has 4 columns and some has 5 columns.  So the columns in pageBlockTables are not in line. I want to figure out a way to set the first 2 column and the last one column width to a fixed number, so the whole page looks better. I understand that we can use <apex:column width="120"> to set the column width. But because my page dynamically rendering the columns, I don't know how I can figure out the first 2 columns and last column and set the width. Any idea is appreciated!
I have a visual force page for a custom object. I have build a custom controller for this custom object, then embed this page in Contact Detail page. I put a drill down for a field in the visual force page to drill down to the detail page of this custom object which is a standard page. The custom detail page is actually rendered inside the iFrame, but I want it to go to the detail page. 

I looked it up on google, and found this examplehttp://stackoverflow.com/questions/11552514/visualforce-page-embedded-in-a-detail-page-that-needs-to-redirect-to-other-page. 

I tried, but it doesn't work for me.  Here is my controller class, I have omitted other logics. 

public with sharing Class FinAccntFilterByTypeController {
   private ApexPages.StandardController controller {get; set;}
    public String redirectUrl {get; set;}
public FinAccntFilterByTypeController( ApexPages.StandardController controller){
      //initialize the stanrdard controller
        this.controller = controller;
}
public PageReference doStuffAndRedirect() {
        redirectUrl = controller.view().getUrl();

        System.debug ('URL '+redirectUrl);
        return null;
    }

Here is my page, please ignore the variables, basically, I have repeat loop through list and fields, I have a outputLink with onClick to call doStuffAndRedirect, then I have the javascrip part to add 
window.top.location.href to redirect. After I added the javascript part, whenever I go to Contact page, without click on outputLink field, it automatically navigates to the redirectUrl. Is there anything wrong with my code?


<apex:page standardController="Contact" id="fapage" extensions="FinAccntFilterByTypeController">
<apex:repeat value="{!availableCategories}" var="category">
  <apex:pageBlock title="{!category}" >
  <apex:pageBlockTable value="{!finAcctListByCategory[category]}" var="fa" rendered="{!NOT(ISNULL(finAcctListByCategory[category]))}" title="category">
    <apex:repeat value="{!fieldListByCategory[category]}" var="field">
    <apex:column headerValue="{!fieldLabelMapByCategory[category][field]}" value="{!fa[field]}" rendered="{!field!='Account_Number__c'}"></apex:column>
    <apex:column headerValue="{!fieldLabelMapByCategory[category][field]}" rendered="{!(field='Account_Number__c')}">
         <apex:outputLink onClick="doStuffAndRedirect">{!fa[field]}
                <script type="text/javascript">
                    window.top.location.href = '{!redirectUrl}';
                </script>    
         </apex:outputLink>
    </apex:column>    
    </apex:repeat>
    </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:repeat>
</apex:page>
I have a visual force page based on a custom object. I have include this page as a section in Contact standard page.  I need to create a drill down for one of the field to naviage to custom object detail page. The outputlink I put as the following
<apex:outputLink value="/{!fa.ID}">{!fa[field]}</apex:outputLink>
If I do this way, if I drill down, the target view is rendered inside the section in Contact standard page, the URL doesn't change.

If I do the following
<apex:outputLink value="/apex/{!fa.ID}">{!fa[field]}</apex:outputLink>
If I drill down, it navigates to some URL, but the target URL is not right, the URL is  https://c.na15.visual.force.com/apex/a04i000000EJYTZAA5. 

So value="/{!fa.ID}" is correct, but only specify this as value, it doesn't navigate to out from the contact standard page. 
I have a custom object A, it has a type field
if I have the following records in A
Name.       Type
aaa.           Checking
bbb.            Checking
ccc.            Investment
ddd.            Saving

I want to build a page showing 3 sections 
Checking
aaa
bbb

Investment
ccc

Saving
ddd

it is possible that the data doesn't contain Saving type of record, then I don't want Saving section showing up. It is possible that new types are added, for example, we have another Type Retirement added. 
eee. Retirement
then I want to have another section rendered. Basically I can't hard code the name of the Type because it can change/expand, and I can't put fixed number of sections in page because it could change based on Tyes. 
Is there any way to achieve this?


I have A and B custom object, A and B has master detail relationship. In A, I want to have a custom field to concatenate a string field value from its all child records. It is similar to the rollup field, but rollup field only works for date or number. It seems Formula type attribute can't access child records. 
For example
B has two records, name is the string attribute, the two records have name="John Smith" and name ="Joan Smith"
I want to create a custom field called Holders ="John Smith and Joan Smith"
How can I do that through configuration? If it is not doable through configuration, and I have to write a Apex class to do the concatendation, how can I trigger the concatenation when access the parent record?
I am very new to Force.com development. Any pointer would be very much appreciated
I was able to enable country and state picklist based on https://na15.salesforce.com/help/pdfs/en/state_country_picklists_impl_guide.pdf for account and contact. But when I create a custom field, there is no address type or state type to choose, nor I can create a lookup relationship to leverage SFDC out of box State pick list values. How can I create a custom field to use SFDC out of box state pick list value? It really doesn't make sense to create a text field and code those state values again giving that the SFDC state picklist is already available
I have a visual force page embedded in Contact detail page layout. I have a output link to drill down to detail custom object page. I have the following in my page, and it drill down correctly to detail custom object page, but it doesn't work when do right click Open in New Tab, I got 
URL No Longer Exists error

<apex:outputLink onClick="window.top.location.href = '{!redirectUrl}';">{!fa[field]}
</apex:outputLink>

How to make the output link work for both drill down in the same window as well as Open in New Tab?

Thanks
  • August 03, 2014
  • Like
  • 1
I have a page using apex:repeat to generate the content dynamically.  The page code is like the following
<apex:pageBlock >
  <apex:repeat value="{!Categories}" var="category">
     <apex:pageBlockSection title="{!category}" columns="1">
         <apex:pageBlockTable value="{!AcctListByCategory[category]}" var="fa"  title="category">
            <apex:repeat value="{!fieldListByCategory[category]}" var="field">
                   <apex:column value="{!fa[field]}" >
                   </apex:column>  
            </apex:repeat>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
  </apex:repeat>
</apex:pageBlock>

Because each category the number of fields are different, some has 4 columns and some has 5 columns.  So the columns in pageBlockTables are not in line. I want to figure out a way to set the first 2 column and the last one column width to a fixed number, so the whole page looks better. I understand that we can use <apex:column width="120"> to set the column width. But because my page dynamically rendering the columns, I don't know how I can figure out the first 2 columns and last column and set the width. Any idea is appreciated!
I have a visual force page using angular JS. I have include this page as a section in Contact standard page.  I need to create a drill down for one of the field to naviage a standard detail page. I understand how to do this in visual force page using outputlink. But my page is using Angular JS, 
If I do the following

<div  class="card"  ng-repeat="story in stories">
      <a id="link-3" ng-href = "/{{story.Id}}">{{story.title}}</a>
</div>

it opens the iframe in current section. 

If I use do the following as I used in outputlink


<a id="link-3" ng-href ="window.top.location.href ='/{{story.Id}}'">{{story.title}}</a>
or
<a id="link-3" ng-click ="window.top.location.href ='/{{story.Id}}'">{{story.title}}</a>
neither one is working at all. I can see story.Id is resolved correctly when I inspect element in browser. 

Any help is appreciated !
  • August 30, 2014
  • Like
  • 0
I tried to enable tags, I go to Customize -> Tags, I can only see Enable Personal Tags checkbox, but I don't see Enable Public Tags checkbox. Is there another setup to enable Enable Public Tags?
I have a page using apex:repeat to generate the content dynamically.  The page code is like the following
<apex:pageBlock >
  <apex:repeat value="{!Categories}" var="category">
     <apex:pageBlockSection title="{!category}" columns="1">
         <apex:pageBlockTable value="{!AcctListByCategory[category]}" var="fa"  title="category">
            <apex:repeat value="{!fieldListByCategory[category]}" var="field">
                   <apex:column value="{!fa[field]}" >
                   </apex:column>  
            </apex:repeat>
        </apex:pageBlockTable>
    </apex:pageBlockSection>
  </apex:repeat>
</apex:pageBlock>

Because each category the number of fields are different, some has 4 columns and some has 5 columns.  So the columns in pageBlockTables are not in line. I want to figure out a way to set the first 2 column and the last one column width to a fixed number, so the whole page looks better. I understand that we can use <apex:column width="120"> to set the column width. But because my page dynamically rendering the columns, I don't know how I can figure out the first 2 columns and last column and set the width. Any idea is appreciated!
I have A and B custom object, A and B has master detail relationship. In A, I want to have a custom field to concatenate a string field value from its all child records. It is similar to the rollup field, but rollup field only works for date or number. It seems Formula type attribute can't access child records. 
For example
B has two records, name is the string attribute, the two records have name="John Smith" and name ="Joan Smith"
I want to create a custom field called Holders ="John Smith and Joan Smith"
How can I do that through configuration? If it is not doable through configuration, and I have to write a Apex class to do the concatendation, how can I trigger the concatenation when access the parent record?
I am very new to Force.com development. Any pointer would be very much appreciated