• JessB
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 7
    Replies
Hi,

I was using HTML component in home page component for advance search functionality in Narrow (Left) Column of Home Layout. My HTML component was 
<script language="JavaScript" type="text/javascript"> 
function setFocusOnLoad() {} 
function submitSearchForm(){ 
var searchField = document.getElementById('advsearchfield'); 
document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + encodeURIComponent(searchField.value); 
return true; 
} 

</script> 

<form name="advsrch" method="post" onsubmit="return submitSearchForm();"> 
<input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr" />
<input class="btn" value=" Go! " type="submit" /> 
</form>


Now that component is not visible in Summer 15 org, so for the workaround I have created visualforce component and create VF page, below is my code of VF page
<apex:page > 

<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" /> 
<apex:includeScript value="{!$Resource.advSearch}"/> 

</apex:page>

advSearch.js (Static Resource) is
 
$(document).ready(function () { 
function setFocusOnLoad() {} 
function submitSearchForm(){ 
var searchField = document.getElementById('advsearchfield'); 
document.advsrch.action = '/search/SearchResults?searchType=2&sen=0&setLast=1&str=' + encodeURIComponent(searchField.value); return true; 
} 

$form = $("<form/>",{name:"advsrch"},{method:"post"},{onsubmit:"return submitSearchForm();"} ); 
$form.append('<input class="searchTextBox" id="advsearchfield" maxlength="80" size="18" name="sbstr" />'); 
$form.append('<input class="btn" value=" Go! " type="submit"/>'); 

$('body').append($form); });

After doing all the changes, I have found couple of issues 

1) Its not showing the blue container as it is now VF component. Requirement is to show the advance search text field and button in blue container just like other components.
2) Its not calling the function same way as it was before, now it refreshing the whole page   and not going link which I am providing. 

Not sure what am I missing or whats need to be done. Any help would be appreciated. Thanks much 

Hi,

 

My Custom Object is called Training (API is Training__c). This Custom Object's Parent in the Master-Detail relationship is Accounts.

 

I currently have a VF page that sits on the Custom Object that shows only the iFrame for the related Contact list, but it allows users to edit the Contacts/create new ones from inside the frame, and therefore, it loses it's inital purpose: simply to list the Contact associated with the Account. I want to replace it with a simple table that returns a list of Contacts (First Name and Last Name, Title, Email).

 

 

I discovered I could create my own little table with a basic list, and put it on the Account page to test the list generation (works perfectly). My issue is that this same code does not work when I set the Standard Controller to "Training__c". I'm brand-new to VF so I know I need to adjust my code so that the same list that generates on the Account appears on my Custom object. 

 

I appreciate your help and feedback; I am trying to learn!

 

 

My VF page that works on the Account page layout:

<apex:page standardController="Account" tabStyle="Contact" >
    <apex:pageBlock title="Contact List">
    <apex:dataTable value="{!account.Contacts}"
        var="contact"
        cellPadding="4" border="0.5">
        <apex:column >
            <apex:facet name="header">Full Name</apex:facet>
           <apex:outputText value="{!contact.FirstName} {!contact.LastName}" escape="false" />
            </apex:column>
        <apex:column >
            <apex:facet name="header">Title</apex:facet>
            {!contact.Title}
            </apex:column>
        <apex:column >
            <apex:facet name="header">Email</apex:facet>
            {!contact.Email}
            </apex:column>
        </apex:dataTable>
    </apex:pageBlock>
</apex:page>

 

 

 

 

My class:

public class mySecondController{

    public Account getAccount() {
        return [select id, name,
                (select id, firstname, lastname
                 from Contacts limit 20)
                from Account where id=
                :System.currentPageReference()
                .getParameters().get('id')];
    }
}

 

Hi, 

 

I have a custom object that I want it's master's Contact list (custom object master is Accounts) to appear on a VF page. I know how to get the webpage to appear in the visualforce page, but how to I get only the Contact related list, that shows in the browser after you click "Go To List", to appear (without sidebars, headers, tabs, footers, etc.)?

 

I have this:

<apex:page standardController="Training__c">
<apex:iframe src="/003?rlid=RelatedContactList&id={!Training__c.AccountID__c}" scrolling="true" id="theIframe"/>
</apex:page>

 

Which appears as the whole webpage, but I want it to display just the related list, without the salesforce headers, without the tabs, without the sidebar, without the footer.... just the table with the list.

 

How do I adjust my VFP to appear as I want?

 

 

I have a VisualForce page to Change the Lead Status, that is opened from the Lead Record page.

 

The idea is that instead of making someone on their mobile device have to click "Edit" and scroll to find the Lead Status field, and then save, we want them to be able to click a button at the top of the Lead record page that opens the VisualForce page with the one field, "Lead Status", that the user can change, and then by hitting the "Save" button, it returns them to the Lead record page with the new saved value

 

This would be great if we could create a Cancel button on the VF page that wouldn't save anything, and just return the user to the Lead record page.

 

I am a total newbie to VF, so I am not sure if there is some kind of Trigger or S-Control that needs to be created, and then added to this code?

 

I feel like this is probably something simple that someone out there could help me get working correctly (since it's one field to update).

 

Here is the VF page:

<apex:page standardcontroller="Lead">
    <apex:form >
    <a name="skiplink"><img src="/s.gif" height='1' width='1' alt="Content Starts Here" class="skiplink skipLinkTargetInner zen-skipLinkTarget" title="Content Starts Here"/></a><div class="bPageTitle"><div class="ptBody"><div class="content"><img src="/s.gif" alt="Lead"  class="pageTitleIcon" title="Lead"/><h1 class="pageType noSecondHeader">Change Status</h1><div class="blank">&nbsp;</div></div><div class="links"><a href="javascript&colon;openPopupFocusEscapePounds(%27/HelpAndTrainingDoor?loc=help&amp;target=leads_massaction.htm&amp;section=Leads%27, %27Help%27, 1024, 768, %27width=1024,height=768,resizable=yes,toolbar=yes,status=yes,scrollbars=yes,menubar=yes,directories=no,location=yes,dependant=no%27, false, false);" title="Help for this Page (New Window)"><span  class="helpLink">Help for this Page</span><img src="/s.gif" alt=""  class="helpIcon"/></a></div></div><div class="ptBreadcrumb"></div></div>
   <h1>Select New Status</h1>
   <apex:inputfield value="{!Lead.Id}"/>
   <apex:inputfield value="{!Lead.Status}"/>
   <apex:commandbutton value="Save" action="{!Save}"/> <apex:commandbutton value="Cancel" action="{!Cancel}"/>
    </apex:form>
</apex:page>

 

I want to be able to perform a search to find all Accounts within a, say, 50 mile radius of a specified zipcode.

 

I have an excel sheet that has all zipcodes, and the respective lat/lng degrees of the "center" of the zipcode. Also, the excel list includes the city, state, and state abbreviation.

 

We also have Find Nearby installed, but I am unfamiliar with this, and if it can search by a radius, and produce a LIST, not a map, of the results.

 

It would be great if we could run a report or something (custom object?) to produce this list. Any ideas? 

 

I'm not sure if this would be an Apex code or not.

I'm trying to create a workflow rule that triggers an approval process when the value of Picklist Field X changes from Old Value 'A' or Old Value 'B' to New Value 'C'.

 

Any help is appreciated.

 

 

Thanks,

Greg

Message Edited by gregarious on 03-03-2010 03:55 PM
Message Edited by gregarious on 03-03-2010 03:56 PM