• charlie_v
  • NEWBIE
  • 125 Points
  • Member since 2008

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 20
    Replies

OK guys ... I've spent an entire afternoon on this and have no clue ...

 

I'm customizing the Customer Portal.  I have created a .html file to load into the header so it calls the custom CSS.

 

Everything is working fine in Chrome, Firefox and Safari.

 

But IE8 refuses to acknowledge the external stylesheet, which is stored in Documents.  I've tried both relative URL's and normal URL's in the link tag ... neither work.

 

I can't find anything online about this.  Does anyone know?  I'm up against a deliverable deadline here and I'm starting to panic.  Help!

 

Here's the code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"  >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Company Customer Portal</title>
<link rel="stylesheet" type="text/css" href="https://c.na2.content.force.com/servlet/servlet.FileDownload?file=01540000000Wuuk"/>
</head>

<body>
</body>

</html>

 

 

I've created a pre-release developer sandbox to test out Winter '12 and have been working with Siteforce.

 

I'd like to experiment with exposing a Salesforce object (custom or standard) via Siteforce - I attended a demo at Dreamforce that did this exact thing. However, I can't see anyway to do this and the help has no information on this.

 

Can someone confirm if this feature is not in the current release or am I failing to spot the option somewhere.

We are seeking to increase our developer resources and am seeking those who have passed the certification exam or have the ability to do so.  Likewise we are also seeking to bring on one new certified consultant who has passed the consultant certification exam.

Hi there.

 

Found this code on the boards for a controller Extension and got it working ok, but am struggling with the test method.

 

How do I create a parent record and get it associated with the child record for the test ?? I think the relationship is messing me up ...

 

 

public class PostCommentExtension { public List<Headline_Comment__c> nhc {get; set;} private final Headline__c parHeadline; public PostCommentExtension(ApexPages.StandardController myController) { parHeadline=(Headline__c)myController.getrecord(); nhc = new List<Headline_Comment__c>(); Headline_Comment__c Comment = new Headline_Comment__c(); Comment.Headline__c = parHeadline.id; nhc.add(Comment); } public PageReference save() { insert nhc; PageReference home = new PageReference('/headlines_with_comments?id='+parHeadline.id); home.setRedirect(true); return home; } public PageReference cancel() { PageReference back = new PageReference('/headlines_with_comments?id='+parHeadline.id); back.setRedirect(true); return back; } }

 

 Does anyone have any code they can paste here so I can see how to get this running?  Sorry if this is basic ... Admin going on Developer and still learning.

 

Thank you.

Charlie

 

Is there a way to insert an image from Documents into an <apex:inputTextarea> field?

I've been trying all morning to get this unit test to work, and now after reading through posts have gotten myself totally confused.

 

Here's the controller:

 

public class HeadlineAndComments { List<Headline__c> headlines; public List<Headline__c> getHeadlines() { if(headlines == null) { headlines = [Select h.Number_of_Comments__c, h.Name, h.Most_Recent_Comment__c, h.Item__c, h.Id, h.Headline_Posted_Date__c, h.CreatedDate, (Select Comment_By__c, Email__c, Comment__c, Comment_Brief__c, Comment_Posted_Date__c, Comment_Date__c From Headline_Comments__r WHERE Post_to_Site__c = TRUE ORDER BY Name) From Headline__c h Where Id = :ApexPages.currentPage().getParameters().get('id')]; } return headlines; } }

 

Here's the unit test I've been working on.

 

public static testMethod void testHeadlineAndCommentsController() { // Create new Headline__c Headline__c h1 = new Headline__c(Name='Test Headline',Item__c='Test Item'); insert h1; // Get a page reference to our newly created headline PageReference pg1 = new PageReference('/apex/PublicHeadlinesWithComments4?id='+h1.Id); System.test.setCurrentpage(pg1); Headline__c h2 = new Headline__c(); ApexPages.standardController sc2 = new ApexPages.standardController(h2); HeadlineAndComments cn2 = new HeadlineAndComments(sc2);

 

I thought what I needed to do was:

  1. Create new Headline__c record
  2. Run the query
  3. Assert and see if the ID of the query match the ID of the record I just created

If the logic is correct, then I'm too ignorant on the syntax to understand how to actually get it to test the controller 'HeadlineAndComments'.

 

Help?

 

 

Does anyone have a code sample of a controller that pulls in SOQL of a child object, where the child object's records are related to the ID of the parent object currently displayed on the page?

 

This is what I have, but it's not working:

 

public class HeadlineWithCommentsController { Headline__c[] headline = [SELECT Id, Name, Item__c, (SELECT Id, Name, Comment__c, Comment_Brief__c, Comment_By__c, Email__c, Post_to_Site__c FROM Headline_Comments__r WHERE Post_to_Site__c = True) FROM Headline__c WHERE Id = :ApexPages.currentPage().getParameters().get('id')]; }

 

 

 

Can someone please help me with this? 

 

I have 2 custom objects:  Headline__c, and Headline_Comments__c.

 

Headline__c is the 'master' in a Master-Detail relationship with Headline_Comments__c.

 

When viewing a headline record, I want to show all associated comments.  But I need to filter the related list to return only those comments where "Post_to_Site__c" equals TRUE.

 

Here's the controller:

 

public class HeadlineCommentsController { Public Headline__c[] getHeadline(){ return [SELECT Id, Name, Item__c FROM Headline__c WHERE Id = :ApexPages.currentPage().getParameters().get('id')]; } Public Headline_Comment__c[] getHeadlineComments(){ return [SELECT Id, Name, Comment__c, Comment_Brief__c, Comment_By__c, Email__c, Post_to_Site__c FROM Headline_Comment__c WHERE Headline__r.ID = :ApexPages.currentPage().getParameters().get('id') AND Post_to_Site__c = True]; } }

 

Here's the VF page:

 

<apex:page Controller="HeadlineCommentsController"> <apex:pageBlock title="Comments" > <apex:repeat value="{!HeadlineComments}" var="each"> Posted by {!each.Comment_By__c} {!each.Comment__c} </apex:repeat> </apex:pageBlock> </apex:page>

 

The problem is, I can get the comments to show just fine, but when I try to expose any of the Headline fields in my VF page, something like

 

<apex:detail subject="{!Headline}" relatedList="false"> </apex:detail>

 

I keep getting the following error:

 

Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.
 

I've checked all the security, and as the Admin I should have access to the VF Page, all the Objects, all the Fields, and the Apex class.

 

Can someone please point me in the right direction?  I'm not a coder by trade, so code samples would be appreciated.

 

Thank you.

 

 

 

 

 

Hi there. I am a new salesforce user, and currently trying to develop something for our sales team at the office. (banking/finance). I am an absolute noob, so my questions are probably quite dumb.., but here goes.

 

Using the Force.com free licence facility, I am setting up a reasonably simple sales platform for my colleagues & manager and have been able to configure users, and got my account & contact base up. The problem is, my first test user/colleague can log in, but i cant seem to set his home page & tabs etc to be the same as mine. How do I control his screen layouts etc to be uniform and thereby create a uniform system across my user base?

 

Any help will be welcome...

 

Cheers 

Hoping someone will have a good tip for this...

 

I have a custom object that I'm exposing on Sites.

 

Each record in the custom object has a screen shot image.  The custom object has approximately 200 records.

 

Question #1:  Are Static Resources the ONLY way to expose images in a VF Sites page?

 

If the answer is yes, then

 

Question #2: Does that mean every time I add a new record to my custom object, and that record includes a screen shot, I will need to update my static resource file before I can expose that image with the record on Sites?

 

 

Both of these pages work fine in the SF environment, but they won't work in Sites.  The first works fine in Sites, but the 2nd returns the "under construction" message.

 

I've checked and double-checked the public access settings.  Am I overlooking the obvious here somewhere?

 

Here's the first page.  This works fine in Sites.

 

 

<apex:page standardController="Sites__c" showHeader="true" sidebar="false" tabStyle="Sites__tab" recordSetVar="Sites__c"> <apex:pageBlock title="Database of Sites"> <table> <tr> <td style="width: 100%"> <apex:form id="sitesForm"> <apex:panelGrid columns="2"> <apex:outputLabel value="View: "> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="sitesListing"/> <apex:selectOptions value="{!listviewoptions}"> </apex:selectOptions> </apex:selectList> </apex:outputLabel> </apex:panelGrid> <apex:pageBlockSection title="Listing" collapsible="false"> <apex:pageBlockTable id="sitesListing" value="{!Sites__c}" columns="1" var="sites"> <apex:column > <apex:outputLink value="Public_Sites_Detail?id={!sites.id}" id="theLink">{!sites.name}</apex:outputLink> </apex:column> </apex:pageBlockTable> </apex:pageBlockSection> <apex:panelGrid columns="2"> <apex:commandLink action="{!previous}">Previous</apex:commandLink> <apex:commandLink action="{!next}">Next</apex:commandLink> </apex:panelGrid> </apex:form> </td> <td> </td> </tr> </table> </apex:pageBlock> </apex:page>

 

 

 

 

 Here's the 2nd page.  Clicking a link in the first page (Public_Sites) should pull up the record in this 2nd page (Public_Sites_Detail) ... but instead you get the "under construction message":

 

 

<apex:page standardController="Sites__c" showHeader="true" sidebar="false" tabStyle="Sites__tab"> <apex:sectionHeader title="{!Sites__c.name}" /> <apex:pageBlock > <apex:pageBlockSection columns="2" showheader="false"> <apex:outputField value="{!Sites__c.Name}"/> <apex:outputField value="{!Sites__c.Rating__c}"/> </apex:pageBlockSection> <apex:pageBlockSection columns="1" showHeader="false"> <apex:outputField value="{!Sites__c.Description__c}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:page>

 

 

 

In the detail pages for Contacts Account and Opportunities there is a related list Activity History. It seems to only show the activities "assigned" to you. How can we make it show all activities for all users. The reasoning is that is it usefull for us to see if somebody else has an activity done or in progress for this account rather than stepping on their toes.

 

Thanks. 

Hi ,

 

I am trying to create a sample visual page with recruitment application but when i try to show fields data from related list, I am getting the following error.

 

Error: Invalid field Job_application__r for SObject Position__c 

 

here is my code.

 

<apex:page standardController="Position__c" id="thePage">
<apex:form >
<apex:pageBlock >
<apex:pageMessages ></apex:pageMessages>
<apex:pageBlockButtons location="bottom">
<apex:commandButton action="{!save}" value="Save"></apex:commandButton>
<apex:commandButton action="{!cancel}" value="Cancel"></apex:commandButton>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="1">
<apex:inputField value="{!Position__c.Department__c}">
</apex:inputField>
<apex:inputField value="{!Position__c.Job_Description__c}">
</apex:inputField>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock>
<apex:pageblockTable value="{!Position__c.Job_application__r}" var="JA">
<apex:column value="{!JA.Candidate__c}">
</apex:column>
<apex:column value="{!JA.Candidate_Qualified__c}">
</apex:column>
</apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Using a custom controller, I am selecting id, name, etc from Account where id = current page's accountid.  That seems to be working fine.

Next, I need to list all of the Contacts for the account in a drop-down list on my Apex page.  Once a user selects a Contact, I need to capture and store the contactid.

This is the error message I keep getting:  Compile Error: Constructor not defined: [System.SelectOption].<Constructor>(Id) at line 18 column 29

Here's my class code.  What am I doing wrong?  I lifted this from an example shown at http://forums.sforce.com/sforce/board/message?board.id=Visualforce&message.id=2344.

Code:
public class comboOppController {

    public Account getAccount() {
        return [select id, Name, Phone from Account
        where id = :ApexPages.currentPage().getParameters().get('id')];
    }
    
    public String selectedContact {get;set;}
    
    public List<SelectOption> contactList;
    
    public List<SelectOption> getContact () {
        if (contactList == null) {
            List<Contact> contactee = [select id, name, contact.accountid from Contact where contact.accountid = :ApexPages.currentPage().getParameters().get('id')];
            
        contactList = new List<SelectOption>();
        for (Contact c : contactee) {
            contactList.add(new SelectOption(c.id));
        }
    }
    return contactList;
    }

}