• Haya
  • NEWBIE
  • 45 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 81
    Replies
We built a customer portal in a sandbox  API version 30.0. We have a staging and a production site API version 29.0.
When we use the ant migration tool we get the following:
BUILD FAILED
C:\Users\grayh\Documents\Forte - Salesforce Customer Portal\Migration tool files\test deploy 03-23-2014\build.xml:75: Failed to login: UNSUPPORTED_API_VERSION - Invalid Api version specified on URL

Is there a way to get around this short of upgrading to version 30.0?

Thanks you,
Haya
  • March 26, 2014
  • Like
  • 1
We would like our customer portal users to be able to update their own profile.

Our MyProfilePageController says : Guest users are never able to access this page.

How do I give the portal users permission to update their profile? (We don’t want the self-registration option available to them.)

Thank you,
Haya
  • February 06, 2014
  • Like
  • 0
Hello to all and Happy New Year,

My customer portal is not independent of the sandbox.
I have a customized url that takes me to the portal.
If the sandbox is not active in the browser most of my images are broken, when i logon to the sandbox the images are displayed correctly.
This is happening on IE, FF and Chrome.

Can someone help me out?

Regards,
Haya
  • January 17, 2014
  • Like
  • 0

We have a customer portal set up.

 

I would like to replace the login page with a customized login page which I have already created.

 

When I go to Site Edit

I see:

Login URL https://cs3.salesforce.com/secur/login_portal.jsp?orgId=00DQ0000003Mfxi&portalId=060Q00000000R0t

 

I would like to replace the login_portal.jsp with my page.

 

How would  I go about doing that?

 

Your help would be greatly appreciated,

Haya

  • October 25, 2013
  • Like
  • 0

 

I posted this in the Apex Code Board and didn't get an answer.
Maybe this is a more appropriate board for the question.

I have a simple visual force page listing case numbers with some details.

I have spent days searching for a way to let the user resort the columns on the page.

I found many discussions and lots of code attempting to do the same.

My question is:

Why can't I use the existing tools in SF? When in SF looking at cases in queves I can sort ascending and descending on columns.

I saw developers uploading up and down arrows images. Why do we need to do that if those images already exist in Sales Force?

Is there anyway to use the code and the images  that SF uses to resort columns in a visual page using apex?

 

if not can someone help me with this issue?

thanks.

Haya

  • October 03, 2013
  • Like
  • 0

I have a simple visual force page listing case numbers with some details.

I have spent days searching for a way to let the user resort the columns on the page.

I found many discussions and lots of code attempting to do the same.

My question is:

Why can't I use the existing tools in SF? When in SF looking at cases in queves I can sort ascending and descending on columns.

I saw developers uploading up and down arrows images. Why do we need to do that if those images already exist in Sales Force?

Is there anyway to use the code and the images  that SF uses to resort columns in a visual page using apex?

 

thanks.

Haya

 

  • September 20, 2013
  • Like
  • 0

I have an extension with the following:

     caseOpen = [Select Priority,CaseNumber,Accountid,Subject,Contactid,CreatedDate,Ownerid,Status,SuppliedName   
                    from case

Which works fine.

 

I want to add a field: Owner, and I get the msg: Error: Compile Error: No such column 'Owner' on entity 'Case'.

 

It is a field in Case. The difference from the other fields is that it has Data Type Lookup(user,Queue)

 

How do I go about getting the field?

 

THanks,

Haya

  • September 13, 2013
  • Like
  • 0

I am developing a customer portal.

I would like the components on the home page be different than on the rest of the pages.

I went to Setup -> Customize -> Home -> Home Page Layouts and selected the components I want.

The problem is that  it changed all the pages

How do I set up the page layout for the other pages to be different?

 

Thank you in advance,

Haya

  • September 12, 2013
  • Like
  • 0

I have 2 buttons on a page: Save and Clear.

How do I clear values from the page if the Clear button is clicked?

 

Help would be greatly appreciated

 

My page:

<apex:page standardController="Case" showHeader="true" sidebar="true" extensions="RequestNewExtension"  tabStyle="New_Request__tab">
  <apex:form >
  <apex:sectionHeader subtitle="Create a Request">
  <div style="float:right">
        <span class="requiredExample">&nbsp;</span>
        <span class="requiredMark">*</span>
        <span class="requiredText"> = Required Information</span>
  </div>
    </apex:sectionHeader>


  <apex:pageMessages />  
    <apex:pageBlock >
        <apex:pageBlockButtons location="both">
                <apex:commandButton value="Save" action="{!Save}" />
                <apex:commandButton value="Clear" action="{!Cancel}" />
            </apex:pageBlockButtons>
<apex:pageBlockSection id="cas14" title="Request Subject/Description" collapsible="false" columns="2">

                 <apex:pageBlockSectionItem >
                <apex:outputLabel >Subject</apex:outputLabel>                
                <apex:inputField id="caseSubject" value="{!case.Subject}" style="width:90%" required="true" />
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem > </apex:pageBlockSectionItem>
              
                <apex:pageBlockSectionItem >
                    <apex:outputLabel >Description</apex:outputLabel>                  
                    <apex:inputField id="caseDescription" value="{!case.Description}" style="width:90%; height: 75px" required="true" />
                </apex:pageBlockSectionItem>               
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
                 </apex:pageBlockSection>
   
  <apex:pageBlockSection id="cas5" title="Request Detail:" collapsible="false" columns="2">
        <apex:pageBlockSectionItem >
                   <apex:outputLabel >Request Type</apex:outputLabel>                  
                   <apex:inputField id="caseType" value="{!case.Type}" required="true" />
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>                            
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
                 </apex:pageBlockSection>
      <apex:inputHidden value="{!Comment}" id="theHiddenInput"/> 
                 
  </apex:pageBlock>
  </apex:form>
</apex:page>

 

My Extension:

 

public with sharing class RequestNewExtension {
    public String Comment
    {
        get;
        set;
    }
    public String Description
    {
        get;
        set;
    } 
    public String Subject
    {
        get;
        set;
    }
    public Boolean UseAssignmentRules
    {
        get;set;
    }
   
    public Case cs;
    ApexPages.StandardController controller;
   
    public RequestNewExtension (ApexPages.StandardController con)
    {
        controller = con;
        this.cs = (Case) con.getRecord();
    }
   
    public PageReference Save()
    {
        CaseComment com = new CaseComment();
        if(Comment.Length() > 0)
        {
            com.commentBody = Comment;
            com.ParentId = cs.Id;
            if(UseAssignmentRules == true)
            {
                AssignmentRule  AR = new AssignmentRule();
                AR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1];
               
                //Creating the DMLOptions for "Assign using active assignment rules" checkbox
                Database.DMLOptions dmlOpts = new Database.DMLOptions();
                dmlOpts.assignmentRuleHeader.assignmentRuleId= AR.id;
                controller.getRecord().setOptions(dmlOpts);               
            }
            insert com;
        }
        String retURL = ApexPages.currentPage().getParameters().get('retURL');
        String CurrentId = ApexPages.currentPage().getParameters().get('id');
        PageReference redirectPG;
        if(retURL != null)
            redirectPG = new PageReference('/' + retURL);
        else if(CurrentId != null)
            redirectPG = new PageReference('/' + CurrentId);
       
        controller.Save();
       
         return Page.Request_Create_Thankyou;
    }
    public PageReference Cancel(){
return null;
}
 }

 

 

 

  • September 10, 2013
  • Like
  • 0

I want a login page for a customer portal that uses an image for the background.

 

I tried various approaches.

I first did the following:

  • Saved my image in Documents
  • Created and html file and saved it in Documents
  • Went to Customize > Customer Portal > Settings > Portal Name> Edit > Under the section "Look and Feel", in the Login Message, I  uploaded the html file

The problem I am encountering is that the css/html code for the background image gets striped away on the portal login page. It does show up when I view it inside the portal. I tried posting the code in the html file and in the css file, but it’s gone once it hits the browser.

My html file:

<apex:page>

<apex:stylesheet value="{/Resources.ForteStyles.css}" />

<apex:form id="loginForm" forceSSL="true">

<div style ="background-image: url(https://cs3.salesforce.com/resource/1366889013000/portal_page_bg);

background-repeat:no-repeat; height:500px;padding:120px 80px 80px 80px;" >

<div id="loginBackground">

<h3>Welcome to Forte Customer Portal.</h3>

<form action="" onsubmit="return login()" id="loginform" method="post">

 <p id="notification"></p>

<!-- TEXTBOXES -->

<label>User name</label><br />

<input name="username" type="text" class="text large required" id="username" /><br />

<div class="clearfix">&nbsp;</div>

<label>Password</label><br />

<input name="password" type="password" class="text large required" id="password" /><br />

<div class="clearfix">&nbsp;</div>

<p><input name="btnLogin" type="submit" class="submit" id="btnLogin" value="LOGIN" /></p>

</form>

</div> 

</apex:page>

 

I also tried defining it in my css file and that wasn't successful either:

#loginBackground ( background-image: url(https://cs3.salesforce.com/resource/1366889013000/portal_page_bg);

background-repeat:no-repeat; height:500px;padding:120px 80px 80px 80px;

}

 

And in my html file:

<div id="loginBackground">

 

 

Any ideas would be welcome.

 

Thanks,
Haya

  • August 20, 2013
  • Like
  • 0

I have a visualforce page that lists data sorted be status and case number

Is it possible to divide the page into sections by status with a heading displaying the status?

 

Open Cases

1234
1235
1236
……..

 

Closed Cases

1237
1238
1238
……..

 

Thanks,

Haya

 

 

My page:

 

<apex:page standardController="Case" extensions="CaseExtension" tabStyle="My_Requests__tab">
<apex:stylesheet value="{/Resources.ForteStyles.css}" />
<style>
.hv{text-align:left;font-size:1.2em; color: #1fbdf2;font-weight:bold;}
</style>
<apex:pageBlock title="{!$User.FirstName} Requests" >
<apex:form >
<apex:dataTable value="{!cases}" var="s" columns="5" cellspacing="15" >
apex:commandButton value="Rerender" reRender="mid" oncomplete="initPageBlockTableEnhancer()"/>
<c:pageblocktableenhancer targetPbTableIds="mid,mid2" paginate="true" defaultPageSize="5" pageSizeOptions="5,10,20,30,40,50,100"/>
apex:pageBlockTable value="{! s.CaseNumber}" id="mid">  

<apex:column headerValue="Request Number" headerClass="hv">
<apex:outputLink value="/apex/Viewed_Request_attachment?CaseNumber={!s.CaseNumber}">{! s.CaseNumber}</apex:outputLink>
</apex:column>
<apex:column value="{! s.Subject}" headerValue="Subject" headerClass="hv" />
<apex:column value="{! s.CreatedDate}" headerValue="Date/Time Opened" headerClass="hv" />
<apex:column value="{! s.Ownerid}" headerValue="Request Owner" headerClass="hv" />
<apex:column value="{! s.Status}" headerValue="Request Status" headerClass="hv" />

</apex:dataTable>
</apex:form>
</apex:pageBlock>
</apex:page>

 

My extension:

 

public class CaseExtension {
public list<Case> case1{get;set;}
    public CaseExtension(ApexPages.StandardController controller) {
     
    }
    public list<Case> getcases()
    {
     case1=[Select Priority,CaseNumber,Accountid,Subject,Contactid,CreatedDate,Ownerid,Status from case where Ownerid=:UserInfo.getUserId() or Contactid=:UserInfo.getUserId()  ORDER BY Status, CaseNumber ];  
     return case1;
    }

}

  • August 08, 2013
  • Like
  • 0

In a customer portal I assigned a page as the landing page in Customize Portal Tabs

I assigned the landing page to be the home page in Page Layouts Assignment.

The page consists of a content area and a navigation area (component) .  

When I click on the page’s tab – not the Home tab – I see the whole page.

When I click on the Home tab - only the content area is displayed, not the navigation area.

 

My page:

 

 <apex:page docType="html-5.0" showHeader="true" standardStylesheets="false" sidebar="true">
<apex:stylesheet value="{!URLFOR($Resource.ForteStyles)}" />
<head>
</head>
<body>
<div id="headDiv">
<h1 style="font-weight:bold;color: #5f9bbf; font-size: 1em;">Simple Workflow and Work-class Content</h1><br />
<h2 style="font-weight:bold;font-style:italic; color: #79aac9; ; font-size: .7em;">A customized development plan that supports the most frequent development needs</h2></div>
<div id="containerDiv">
<div id="mainDiv">
<img src="https://cs3.salesforce.com/resource/1375345300000/portal_page_1" />
</div>
<div id="navDiv">
<c:forte_navigation />
</div>
<div class='clear'></div>
</div>
<div id="footDiv" >
</div>
</body>
</apex:page>

 

The navigation component:

 

<apex:component >
<style type="text/css">
#navDiv {width: 250px; margin-left: 25px; float: left; background-color: #d9d9d9; }
#navDivInner { margin: 0 auto; }
.navigTitle {height:40px; text-align:center; background-color:#008699; color:#ffffff;
  font-size:21px; font-family:"Times New Roman", Times, serif; font-weight: bold;
  padding-top: 10px; }
.menu {text-align: center; margin: 0 auto; padding: 0; }
.menu ul {display: inline-block; margin: 0; padding: .5em 10px; }
li.leaf { border: 1px solid #dddddd; background-color: white; color: #008699; display: block;
  margin: .5em 0; padding: 10px; font-weight:bold;
  list-style-position:inside; list-style-type: none; }
li.leaf a:link, li.leaf a:visited { color: #008699; text-decoration: none; }
li.leaf a:hover,li.leaf a:active { color: #000000; text-decoration: underline; }  
</style>
<div id="navDivInner">
<p class="navigTitle">
Powered by Lominger
</p>
<div class="menu">
<ul>
<li class="leaf"><a href="/apex/ForteOverview">Overview</a></li>
<li class="leaf"><a href="/apex/fortehome">Development Plan</a></li>
<li class="leaf"><a href="/apex/competency_library">Competency Library</a></li>
<li class="leaf"><a href="/apex/Success_Profiles">Success Profiles</a></li>
<li class="leaf"><a href="/apex/ProSpective_Assessment">ProSpective Assessment</a></li>
<li class="leaf"><a href="/apex/FYI_Development">FYI Development</a></li>
</ul> 
</div>
</div>  
</apex:component>

 

What am I doing wrong?

Thank you,

Haya

  • August 01, 2013
  • Like
  • 0

I have a  page that lists a user's cases

The user can drill down on a case number and get to a page that displays the case details.

I want to add an Add an Attachment section.

 

I am probably doing some needless looping.  I am missing the connection to the record that I need to add the comment to. The case number should be available to me since this page is the case number's details.

 

This is the error I am getting:

Visualforce Error

 

System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Parent]: [Parent]

 
Error is in expression '{!Upload}' in page viewed_request_attachment

Class.RequestViewExtension.upload: line 53, column 1

 

Line 53 is:          insert myAttachment; 

 

Here is my page:

 

<apex:page standardController="Case" extensions="RequestViewExtension" tabStyle="My_Requests__tab">
<apex:stylesheet value="/resources/ForteStyles.css"/>
<apex:form >
    <apex:pageBlock >

        <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Upload" action="{!Upload}" /> 
        </apex:pageBlockButtons>

<html>
<div>
<apex:repeat value="{!cases}" var="s">
<hr />
Hello {!$User.FirstName}
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color: #1fbdf2; float:left; width: 30%;"> Request Number:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;"><apex:outputLink value="/apex/Viewed_Request?CaseNumber={!s.CaseNumber}">{! s.CaseNumber}</apex:outputLink></p>
</div>
<hr />
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color: #1fbdf2; float:left; width: 30%;"> Request Number:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;"> {!s.CaseNumber} </p>
<div style="clear:both;"></div>
</div>
<hr />
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;"> Subject:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;">{!s.Subject}</p>
<div style="clear:both;">
</div>
</div>
<hr />
<div style="clear:both;width:500px; margin-bottom:20px; ">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;">Description:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 60%;">{!s.Description}</p>
<div style="clear:both;">
</div>
</div>
<hr />
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;">Create date:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;"> {!s.CreatedDate}</p>
<div style="clear:both;">
</div>
</div>
<hr />
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;">Request Owner:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;"> <apex:outputField value="{!s.Ownerid}"/> </p>
<div style="clear:both;">
</div>
</div>
<hr />
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;">Comment:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;"> <apex:outputField value="{!objCaseComment.CommentBody}"/> </p>
<div style="clear:both;">
</div>
</div>
<apex:inputHidden value="{!s.id}" id="fileParent"/>

      <apex:pageBlockSection columns="2"  collapsible="false" id="block1" title="Upload an Attachment">
              <apex:pageBlockSectionItem >
        <apex:outputLabel value="File Name" for="fileName"/>
          <apex:inputText value="{!attachment.name}" id="fileName"/>
        </apex:pageBlockSectionItem>
         <apex:pageBlockSectionItem >
          <apex:outputLabel value="File" for="file"/>
          <apex:inputFile value="{!fileBody}" filename="{!fileName}" id="file"/>
        </apex:pageBlockSectionItem>
         <apex:pageBlockSectionItem >
          <apex:outputLabel value="Description" for="description"/>
          <apex:inputTextarea value="{!fileDesc}" id="description"/>
        </apex:pageBlockSectionItem>
 
      </apex:pageBlockSection>

</apex:repeat>

</div>
</html>
    </apex:pageBlock>
</apex:form>
</apex:page>

 

My Controller:

 

public class RequestViewExtension {
    public Case cs;
        ApexPages.StandardController controller;
 
   
    public RequestViewExtension (ApexPages.StandardController con)
    {
        controller = con;
        this.cs = (Case) con.getRecord();
    }

    public CaseComment objCaseComment{get; set;}
    public list<Case> case1{get;set;}
    public list<Case> getcases()
    {
     case1=[Select Priority,CaseNumber,(select CommentBody from CaseComments),id,Accountid,Subject,Description,Contactid,Ownerid,CreatedDate from case where CaseNumber=:ApexPages.currentPage().getParameters().get('CaseNumber')]; 
     return case1;
    }
    public Attachment attachment {
        get;
        set;
    }
  
    public String Comment
    {
        get;
        set;
    }

    public string fileName  
    {    get;set;    }
   
    public string fileParent  
    {    get;set;    } 
     
    public Blob fileBody  
    {    get;set;    } 

    public string fileDesc  
    {    get;set;    }
   
    public PageReference upload() 
    { 
        PageReference pr; 
        if(fileBody != null && fileName != null) 
        { 
          Attachment myAttachment  = new Attachment(); 
          myAttachment.Body = fileBody;  
          myAttachment.Name = fileName;  
          myAttachment.Description = fileDesc;   
          myAttachment.OwnerId = UserInfo.getUserId();
          myAttachment.ParentId = fileParent ;       
          insert myAttachment; 
          pr = new PageReference('/' + myAttachment.Id); 
          pr.setRedirect(true); 
          return pr; 
        } 
        return null; 
    } 
}

 

 

  • July 17, 2013
  • Like
  • 0

I am trying to collect fields from the Case database, some for display and one for editing.

 

The fields for display are: CaseNumber, Accountid, Subject, Description, Contactid, Ownerid, CreatedDate 

 

The field I want to update is: Comment.

 

I would like to display prior Comments and give the user the option to add a Comment.

 

I am successful in collecting the first set of fields but when I add Comment to the list I get:

                                                                     

Error: Compile Error: No   such column 'Comment' on entity 'Case'. If you are attempting to use a custom   field, be sure to append the '__c' after the custom field name. Please   reference your WSDL or the describe call for the appropriate names. at line   14 column 12

 

I see Comment ilisted n the Case Standard Fields

 

How do I collect the field?

 

Here is my code:

public class RequestViewExtension {
    public Case cs;
        ApexPages.StandardController controller;
   
    public RequestViewExtension (ApexPages.StandardController con)
    {
        controller = con;
        this.cs = (Case) con.getRecord();
    }

    public list<Case> case1{get;set;}
    public list<Case> getcases()
    {
     case1=[Select Priority,CaseNumber,Accountid,Subject,Description,Contactid,Ownerid,CreatedDate from case where CaseNumber=:ApexPages.currentPage().getParameters().get('CaseNumber')];  
     return case1;
    }
    
    public String Comment
    {
        get;
        set;
    }
}

 

 

 

 

  • July 09, 2013
  • Like
  • 0

I have a vf page that lists records for a specific user.

I want to add an option to update a specific record.

I think  I know how to set the form to update the record.

 

What I don't know how to set up is the button that would send the user to the next form to edit the record chosen.

 

 

This is my code:

 

 

<apex:page standardController="Case" extensions="RequestViewExtension" >
<apex:stylesheet value="/resources/ForteStyles.css"/>

<apex:pageBlock >
<apex:form >
<html>
<div>
<apex:repeat value="{!cases}" var="s">
<hr />
Hello {!$User.FirstName}!
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color: #1fbdf2; float:left; width: 30%;"> Request Number:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;"> {!s.CaseNumber}</p>
<div style="clear:both;">
</div>
</div>
<hr />
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;"> Subject:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;">{!s.Subject}</p>
<div style="clear:both;">
</div>
</div>
<hr />
<div style="clear:both;width:500px; margin-bottom:20px; ">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;">Description:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 60%;">{!s.Description}</p>
<div style="clear:both;">
</div>
</div>
<hr />
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;">Create date:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;"> {!s.CreatedDate}</p>
<div style="clear:both;">
</div>
</div>
<hr />
<div style="clear:both;width:500px; height: 50px;">
<p style="font-size:1.2em; text-align:right; color:#1fbdf2; float:left; width: 30%;">Request Owner:</p>
<p style="font-size:1.2em; text-align:left;color:black; float:left; margin-left: 15px; width: 50%;"> <apex:outputField value="{!s.Ownerid}"/> </p>
<div style="clear:both;">
</div>
</div>
<hr />

</apex:repeat>

</div>
</html>
</apex:form>
</apex:pageBlock>
</apex:page>

 

  • July 05, 2013
  • Like
  • 0

My vf page, requestCreate,  is working fine except for when the Cancel button is pressed the user is returned to the home page. I would like for the user to return to the requestCreate page. 

 

I cloned the RequestNewExtension from an existing extension.

 

I have Save and Cancel buttons:

<apex:pageBlockButtons location="both">
<apex:commandButton value="Save" action="{!Save}" />
<apex:commandButton value="Cancel" action="{!Cancel}"/>
</apex:pageBlockButtons>

 

When the user chooses SaveI direct the user to a Thank You pagethat works fine.

 

I tried different codes for the Cancel button unsuccessfully. I would like to return the user back to the requestCreate page

 

Here is my extenstion:

public with sharing class RequestNewExtension {
    public String Comment
    {
        get;
        set;
    }
    public String Description
    {
        get;
        set;
    } 
    public String Subject
    {
        get;
        set;
    }
    public Boolean UseAssignmentRules
    {
        get;set;
    }
   
    public Case cs;
    ApexPages.StandardController controller;
   
    public RequestNewExtension (ApexPages.StandardController con)
    {
        controller = con;
        this.cs = (Case) con.getRecord();
    }
   
    public PageReference Save()
    {
        CaseComment com = new CaseComment();
        if(Comment.Length() > 0)
        {
            com.commentBody = Comment;
            com.ParentId = cs.Id;
            if(UseAssignmentRules == true)
            {
                AssignmentRule  AR = new AssignmentRule();
                AR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1];
               
                //Creating the DMLOptions for "Assign using active assignment rules" checkbox
                Database.DMLOptions dmlOpts = new Database.DMLOptions();
                dmlOpts.assignmentRuleHeader.assignmentRuleId= AR.id;
                controller.getRecord().setOptions(dmlOpts);               
            }
            insert com;
        }
        String retURL = ApexPages.currentPage().getParameters().get('retURL');
        String CurrentId = ApexPages.currentPage().getParameters().get('id');
        PageReference redirectPG;
        if(retURL != null)
            redirectPG = new PageReference('/' + retURL);
        else if(CurrentId != null)
            redirectPG = new PageReference('/' + CurrentId);
       
        controller.Save();
       
         return Page.Request_Create_Thankyou;
    }
 }

  • July 03, 2013
  • Like
  • 0

I have a few visulaforce pages.

I want to control what shows on the sidebar.

 

When I have:

<apex:page docType="html-5.0" showHeader="true" standardStylesheets="false" sidebar="true">

The side bar has information.

 

When I change the code to: sidebar="false"

There is no sidebar.

 

My question:  How do I determine what shows in the sidebar?

 

 

  • July 02, 2013
  • Like
  • 0

I now have a fewTabs for  visualforce pages on my navigation bar.

 

The problem is that when I choose a page, that page's Tab does not become the active one.

 

What do I do to fix that?

 

Here is a sample page:

<apex:page standardController="Case" extensions="CaseExtension">
<apex:stylesheet value="{/Resources.ForteStyles.css}" />
<style>
.hv{text-align:left;font-size:1.2em; color: #1fbdf2;font-weight:bold;}
</style>
<apex:pageBlock title="My Requests" >
<apex:form >
<apex:dataTable value="{!cases}" var="s" columns="5" cellspacing="15" >
<apex:column headerValue="Request Number" headerClass="hv">
<apex:outputLink value="/apex/Viewed_Request?CaseNumber={!s.CaseNumber}">{! s.CaseNumber}</apex:outputLink>
</apex:column>
<apex:column value="{! s.Subject}" headerValue="Subject" headerClass="hv" />
<apex:column value="{! s.CreatedDate}" headerValue="Date/Time Opened" headerClass="hv" />
<apex:column value="{! s.Ownerid}" headerValue="Request Owner" headerClass="hv" />
</apex:dataTable>
</apex:form>
</apex:pageBlock>
</apex:page>

  • July 02, 2013
  • Like
  • 0

I need help again. I am still new at this and I don't fully understand Apex.

 

I wrote a vp for a user to create a new record. Here

 

I am not getting any errors when editing the page, but when I run it I get the following error:

 

Attempt to de-reference a null object

Error is in expression '{!Save}' in page requestcreate

 

 

An unexpected error has occurred. Your development organization has been notified.

 

Here is my code:

 

<apex:page standardController="Case" showHeader="true" sidebar="true" extensions="CaseEditExtension">
  <apex:form >

  <apex:sectionHeader title="Visualforce Form" subtitle="Create a Request"/>

    <apex:pageMessages />  
    <apex:pageBlock title="Welcome {!$User.FirstName}!" id="pgBlock" mode="edit">
    <apex:pageBlockButtons location="both">
                <apex:commandButton value="Save" action="{!Save}" />
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageBlockButtons>

    <apex:pageBlock title="Contact Info">
    <apex:outputLabel >Account Name</apex:outputLabel>                  
    <apex:outputField value="{!case.AccountId}" />
    </apex:pageBlock>
  <apex:pageBlockSection id="pgBlockSectionDescriptionInfo" title="Description Info" collapsible="false" columns="2">
                <apex:pageBlockSectionItem >
                    <apex:outputLabel >Subject</apex:outputLabel>                  
                    <apex:inputText id="caseSubject" value="{!case.Subject}" size="75" />
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
              
                <apex:pageBlockSectionItem >
                    <apex:outputLabel >Description</apex:outputLabel>                  
                    <apex:inputTextArea id="caseDescription" value="{!case.Description}" cols="75" rows="6" />
                </apex:pageBlockSectionItem>               
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
                 </apex:pageBlockSection>
   
  <apex:pageBlockSection id="cas5" title="Case Detail:" collapsible="false" columns="2">
        <apex:pageBlockSectionItem >
                   <apex:outputLabel >Type</apex:outputLabel>                  
                   <apex:inputField id="caseType" value="{!case.Type}" />
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>

              <apex:pageBlockSectionItem >
                    <apex:outputLabel >Case Reason</apex:outputLabel>                  
                    <apex:inputField id="caseReason" value="{!case.Reason}" />
              </apex:pageBlockSectionItem>               
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
                 </apex:pageBlockSection>
       
                 
  </apex:pageBlock>
  </apex:form>
</apex:page>
                       

Thank you for your help.

  • June 28, 2013
  • Like
  • 0

Is there a way to find and clone salesforce page?

I need to re-create a "create new case" page for a customer portal.

I need to customize the page and drop a few of the fields being asked.

How do I find the code behind the salesforce page so I can use it to create a visualforce page?

 

  • June 26, 2013
  • Like
  • 0
We built a customer portal in a sandbox  API version 30.0. We have a staging and a production site API version 29.0.
When we use the ant migration tool we get the following:
BUILD FAILED
C:\Users\grayh\Documents\Forte - Salesforce Customer Portal\Migration tool files\test deploy 03-23-2014\build.xml:75: Failed to login: UNSUPPORTED_API_VERSION - Invalid Api version specified on URL

Is there a way to get around this short of upgrading to version 30.0?

Thanks you,
Haya
  • March 26, 2014
  • Like
  • 1
We would like our customer portal users to be able to update their own profile.

Our MyProfilePageController says : Guest users are never able to access this page.

How do I give the portal users permission to update their profile? (We don’t want the self-registration option available to them.)

Thank you,
Haya
  • February 06, 2014
  • Like
  • 0
Hello to all and Happy New Year,

My customer portal is not independent of the sandbox.
I have a customized url that takes me to the portal.
If the sandbox is not active in the browser most of my images are broken, when i logon to the sandbox the images are displayed correctly.
This is happening on IE, FF and Chrome.

Can someone help me out?

Regards,
Haya
  • January 17, 2014
  • Like
  • 0

We have a customer portal set up.

 

I would like to replace the login page with a customized login page which I have already created.

 

When I go to Site Edit

I see:

Login URL https://cs3.salesforce.com/secur/login_portal.jsp?orgId=00DQ0000003Mfxi&portalId=060Q00000000R0t

 

I would like to replace the login_portal.jsp with my page.

 

How would  I go about doing that?

 

Your help would be greatly appreciated,

Haya

  • October 25, 2013
  • Like
  • 0

Hai , In my vf page code I want to use Standard  Salesforce Styles.  How can I get That. And then I f possible to change to change the standard themes or colors as I Want..Give Some Valuable Ideas.

 

 

Thanks

 

 

I posted this in the Apex Code Board and didn't get an answer.
Maybe this is a more appropriate board for the question.

I have a simple visual force page listing case numbers with some details.

I have spent days searching for a way to let the user resort the columns on the page.

I found many discussions and lots of code attempting to do the same.

My question is:

Why can't I use the existing tools in SF? When in SF looking at cases in queves I can sort ascending and descending on columns.

I saw developers uploading up and down arrows images. Why do we need to do that if those images already exist in Sales Force?

Is there anyway to use the code and the images  that SF uses to resort columns in a visual page using apex?

 

if not can someone help me with this issue?

thanks.

Haya

  • October 03, 2013
  • Like
  • 0

I have an extension with the following:

     caseOpen = [Select Priority,CaseNumber,Accountid,Subject,Contactid,CreatedDate,Ownerid,Status,SuppliedName   
                    from case

Which works fine.

 

I want to add a field: Owner, and I get the msg: Error: Compile Error: No such column 'Owner' on entity 'Case'.

 

It is a field in Case. The difference from the other fields is that it has Data Type Lookup(user,Queue)

 

How do I go about getting the field?

 

THanks,

Haya

  • September 13, 2013
  • Like
  • 0

I am developing a customer portal.

I would like the components on the home page be different than on the rest of the pages.

I went to Setup -> Customize -> Home -> Home Page Layouts and selected the components I want.

The problem is that  it changed all the pages

How do I set up the page layout for the other pages to be different?

 

Thank you in advance,

Haya

  • September 12, 2013
  • Like
  • 0

I have 2 buttons on a page: Save and Clear.

How do I clear values from the page if the Clear button is clicked?

 

Help would be greatly appreciated

 

My page:

<apex:page standardController="Case" showHeader="true" sidebar="true" extensions="RequestNewExtension"  tabStyle="New_Request__tab">
  <apex:form >
  <apex:sectionHeader subtitle="Create a Request">
  <div style="float:right">
        <span class="requiredExample">&nbsp;</span>
        <span class="requiredMark">*</span>
        <span class="requiredText"> = Required Information</span>
  </div>
    </apex:sectionHeader>


  <apex:pageMessages />  
    <apex:pageBlock >
        <apex:pageBlockButtons location="both">
                <apex:commandButton value="Save" action="{!Save}" />
                <apex:commandButton value="Clear" action="{!Cancel}" />
            </apex:pageBlockButtons>
<apex:pageBlockSection id="cas14" title="Request Subject/Description" collapsible="false" columns="2">

                 <apex:pageBlockSectionItem >
                <apex:outputLabel >Subject</apex:outputLabel>                
                <apex:inputField id="caseSubject" value="{!case.Subject}" style="width:90%" required="true" />
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem > </apex:pageBlockSectionItem>
              
                <apex:pageBlockSectionItem >
                    <apex:outputLabel >Description</apex:outputLabel>                  
                    <apex:inputField id="caseDescription" value="{!case.Description}" style="width:90%; height: 75px" required="true" />
                </apex:pageBlockSectionItem>               
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
                 </apex:pageBlockSection>
   
  <apex:pageBlockSection id="cas5" title="Request Detail:" collapsible="false" columns="2">
        <apex:pageBlockSectionItem >
                   <apex:outputLabel >Request Type</apex:outputLabel>                  
                   <apex:inputField id="caseType" value="{!case.Type}" required="true" />
                </apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>                            
                <apex:pageBlockSectionItem ></apex:pageBlockSectionItem>
                 </apex:pageBlockSection>
      <apex:inputHidden value="{!Comment}" id="theHiddenInput"/> 
                 
  </apex:pageBlock>
  </apex:form>
</apex:page>

 

My Extension:

 

public with sharing class RequestNewExtension {
    public String Comment
    {
        get;
        set;
    }
    public String Description
    {
        get;
        set;
    } 
    public String Subject
    {
        get;
        set;
    }
    public Boolean UseAssignmentRules
    {
        get;set;
    }
   
    public Case cs;
    ApexPages.StandardController controller;
   
    public RequestNewExtension (ApexPages.StandardController con)
    {
        controller = con;
        this.cs = (Case) con.getRecord();
    }
   
    public PageReference Save()
    {
        CaseComment com = new CaseComment();
        if(Comment.Length() > 0)
        {
            com.commentBody = Comment;
            com.ParentId = cs.Id;
            if(UseAssignmentRules == true)
            {
                AssignmentRule  AR = new AssignmentRule();
                AR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1];
               
                //Creating the DMLOptions for "Assign using active assignment rules" checkbox
                Database.DMLOptions dmlOpts = new Database.DMLOptions();
                dmlOpts.assignmentRuleHeader.assignmentRuleId= AR.id;
                controller.getRecord().setOptions(dmlOpts);               
            }
            insert com;
        }
        String retURL = ApexPages.currentPage().getParameters().get('retURL');
        String CurrentId = ApexPages.currentPage().getParameters().get('id');
        PageReference redirectPG;
        if(retURL != null)
            redirectPG = new PageReference('/' + retURL);
        else if(CurrentId != null)
            redirectPG = new PageReference('/' + CurrentId);
       
        controller.Save();
       
         return Page.Request_Create_Thankyou;
    }
    public PageReference Cancel(){
return null;
}
 }

 

 

 

  • September 10, 2013
  • Like
  • 0

Thinking of enabling #Communities for your customer? Then be aware of the current #Gotcha that the default Apex Classes that are created when you enable your first Community do not ALL have code coverage >75%.

What this means:
You can enable Communities in Production, however as soon as you attempt to migrate anything from a sandbox into Production that triggers all tests to be run (doesn't have to be just code), your migration will fail as three of the classes only have 33%, 20% and 21%.

Let me repeat that, you might only be migrating a bunch of new custom fields and page layouts and the Change Set (or Eclipse/ANT) will fail.

I hit this problem this week in a go-live deployment so had to update Apex Classes to achieve average total code coverage >75% in order to proceed with our deployment.

The PM of Communities knows about the problem and advises he is looking at a fix, but in the meantime here are the four Apex Classes that need to be updated.

 

CommunitiesLandingControllerTest.cls

Just a one liner for this test class

/**
 * An apex page controller that takes the user to the right start page based on credentials or lack thereof
 */
@IsTest public with sharing class CommunitiesLandingControllerTest {
  @IsTest(SeeAllData=true) public static void testCommunitiesLandingController() {
    // Instantiate a new controller with all parameters in the page
    CommunitiesLandingController controller = new CommunitiesLandingController();

    // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
    PageReference pageRef = controller.forwardToStartPage();
  }
}

 

CommunitiesLoginControllerTest.cls

Just a one liner for this test class

/**
 * An apex page controller that exposes the site login functionality
 */
@IsTest global with sharing class CommunitiesLoginControllerTest {
  @IsTest(SeeAllData=true) 
  global static void testCommunitiesLoginController () {
    CommunitiesLoginController controller = new CommunitiesLoginController ();

    // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
    PageReference pageRef = controller.forwardToAuthPage();
  }  
}

 

CommunitiesSelfRegControllerTest.cls

A few controller variables to set prior to calling the controller method for the original test method, followed by a couple of additional test methods for further coverage.

/**
 * An apex page controller that supports self registration of users in communities that allow self registration
 */
@IsTest public with sharing class CommunitiesSelfRegControllerTest {
  @IsTest(SeeAllData=true) 
  public static void testCommunitiesSelfRegController() {
    CommunitiesSelfRegController controller = new CommunitiesSelfRegController();

    // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
    controller.firstName = 'Bob';
    controller.lastName = 'Jones';
    controller.email = 'bob@jones.com';
    controller.password = '8yhMsHDN&ituQgO$WO';
    controller.confirmPassword = '8yhMsHDN&ituQgO$WO';
    controller.communityNickname = 'bob-jones-testing';

    PageReference pageRef = controller.registerUser();
  }
  // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
  @IsTest(SeeAllData=true) 
  public static void testInvalidPassword() {
    CommunitiesSelfRegController controller = new CommunitiesSelfRegController();
    controller.firstName = 'Bob';
    controller.lastName = 'Jones';
    controller.email = 'bob@jones.com';
    controller.password = '8yhMsHDN&ituQgO$WO';
    controller.confirmPassword = 'not the same';
    controller.communityNickname = 'bob-jones-testing';

    PageReference pageRef = controller.registerUser();
    System.assert(pageRef == null, 'The returned page reference should be null');
  }
  // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
  @IsTest(SeeAllData=true) 
  public static void testNullPassword() {
    CommunitiesSelfRegController controller = new CommunitiesSelfRegController();
    controller.firstName = 'Bob';
    controller.lastName = 'Jones';
    controller.email = 'bob@jones.com';
    controller.communityNickname = 'bob-jones-testing';

    PageReference pageRef = controller.registerUser();
    System.assert(pageRef == null, 'The returned page reference should be null');
  }
}

 

CommunitiesSelfRegController.cls

A few additions to this class to set the Profile and Account Ids for portal user creation. Update the ProfileId value based on the "portal" license(s) (e.g., Customer Portal, Customer Community, etc) and set the AccountId to that of the Account you wish to use for self-registration. Note: this needs to be set even if you're not using self-registration so the class can be tested.

Plus some debug statements so I could see what was happening and needed to be tested.

/**
 * An apex page controller that supports self registration of users in communities that allow self registration
 */
public with sharing class CommunitiesSelfRegController {

  public String firstName {get; set;}
  public String lastName {get; set;}
  public String email {get; set;}
  public String password {get; set {password = value == null ? value : value.trim(); } }
  public String confirmPassword {get; set { confirmPassword = value == null ? value : value.trim(); } }
  public String communityNickname {get; set { communityNickname = value == null ? value : value.trim(); } }
  
  public CommunitiesSelfRegController() {}
  
  private boolean isValidPassword() {
    return password == confirmPassword;
  }

  public PageReference registerUser() {
  
    // it's okay if password is null - we'll send the user a random password in that case
    if (!isValidPassword()) {
      System.debug(System.LoggingLevel.DEBUG, '## DEBUG: Password is invalid - returning null');
      ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match);
      ApexPages.addMessage(msg);
      return null;
    }  

    // 25-Jun-2013 Manu Erwin - Fixing insufficient code coverage for default Communities Apex Tests
    //String profileId = ''; // To be filled in by customer.
    //String roleEnum = ''; // To be filled in by customer.
    //String accountId = ''; // To be filled in by customer.

    // Set this to your main Communities Profile API Name
    String profileApiName = 'PowerCustomerSuccess';
    String profileId = [SELECT Id FROM Profile WHERE UserType = :profileApiName LIMIT 1].Id;
    List<Account> accounts = [SELECT Id FROM Account LIMIT 1];
    System.assert(!accounts.isEmpty(), 'There must be at least one account in this environment!');
    String accountId = accounts[0].Id;
    
    String userName = email;

    User u = new User();
    u.Username = userName;
    u.Email = email;
    u.FirstName = firstName;
    u.LastName = lastName;
    u.CommunityNickname = communityNickname;
    u.ProfileId = profileId;
    
    String userId = Site.createPortalUser(u, accountId, password);
   
    if (userId != null) { 
      if (password != null && password.length() > 1) {
        System.debug(System.LoggingLevel.DEBUG, '## DEBUG: User creation successful and password ok - returning site.login');
        return Site.login(userName, password, null);
      }
      else {
        System.debug(System.LoggingLevel.DEBUG, '## DEBUG: User creation successful but password not ok - redirecting to self reg confirmation');
        PageReference page = System.Page.CommunitiesSelfRegConfirm;
        page.setRedirect(true);
        return page;
      }
    }
    System.debug(System.LoggingLevel.DEBUG, '## DEBUG: User creation not successful - returning null');
    return null;
  }
}