• smagee13
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 11
    Replies

Hello all,

Im looking for the source of what appear to be standard fields on the Lead and Contact objects, they are:

 

EmailBounceDate

EmailBounceReason

 

THey do not appear in the filed list for either object, but are viable to the APEX Data Loader.  The dates in these files are oddly formatted and are causing me some problems when trying to load my data in a SQL server for further analysis.

 

Anybody have any idea where these fields are located and what populates them?

 

Thanks
Scott

All,

 

I am trying to setup a Web-To-Lead form that will also include an attachment.  Does anybody know how to set this up or any code samples I could look at?

 

Thanks!

Hello all,

I am trying to either write a trigger or an APEX class that will copy a lead record into a custom object I have called Candidates. 

 

We installed the lab force.com application called Recruiting and will be using this to track employment candidates at my organization.  What I would like to do is use the Web to Lead functionality to capture candidates information from our public site as a special lead record.  Then have a trigger or class take that lead record and insert a new record, using all the lead fields, into a custom object called Candidates.

 

Do any of you out there know if this is possible, have any code samples or done anything like this?

 

Thanks for your help.

 

 

Im looking for a way to update/reset a number of the submitted Ideas voting total back to 10.   My use case is that I've received a number of Ideas regarding my product and they have been voted on.  I have chosen to implement a handful of them and would like to start the voting process over again, to help prioritize them.  Is there a way I can reset the Idea value of any record back to 10?  Can this be done via Apex or do I need to perform this via a data loader exercise?

 

 

New to javascript development so please be patient.

 

I have a web to lead form that is working just fine and I am not adding some javascript to disable/enable text boxes on a check box selection.  All is working just fine but now I need to post the from to SalesForce Lead and am using custom fields with invalid javascript ID names like "000Ndvdfdf"

 

I've read some workarounds on the boards but can't see to get this working just right.  Below is my code snippet and with this Im receving the dreaded  

 

'document.Form1.adminname' is null or not an object 

 

I have the javascript just above the </body> tag.

 

Any other advise?

<tr> <td width="3%">&nbsp;</td> <td width="18%"><font face="Arial">Same as Above</font></td> <td width="78%"><input type="checkbox" name="Check1" onClick="MTMAdminChange()"/></td> </tr> <tr> <td width="3%">&nbsp;</td> <td width="18%"><font face="Arial">MTM Admin name</font></td> <td width="78%"><font face="Arial"> <input id="00N60000001eqbc" maxlength="100" name="00N60000001eqbc" size="64" type="text" value="Same as above" /></font></td> </tr> <tr> <td width="3%">&nbsp;</td> <td width="18%"><font face="Arial">MTM Admin phone</font></td> <td width="78%"><font face="Arial"> <input id="00N60000001eqbg" maxlength="40" name="00N60000001eqbg" onkeydown="formatPhoneOnEnter(this, event);" size="34" type="text" value="Same as above" /></font></td> </tr> <tr> <td width="3%">&nbsp;</td> <td width="18%"><font face="Arial">MTM Admin email</font></td> <td width="78%"><font face="Arial"> <input id="00N60000001eqbh" maxlength="80" name="00N60000001eqbh" size="64" type="text" value="Same as above"/></font></td> </tr><script language="javascript"> function MTMAdminChange() { var adminname = document.getElementById('00N60000001eqbc'); var adminphone = document.getElementById('00N60000001eqbc'); var adminemail = document.getElementById('00N60000001eqbc'); if (document.Form1.Check1.checked === true) {document.Form1.adminname.disabled = true; document.Form1.adminphone.disabled = true; document.Form1.adminemail.disabled = true;} else { document.Form1.adminname.disabled = false; document.Form1.adminphone.disabled = false; document.Form1.adminemail.disabled = false; } }</script>

 

 

 

Hello all, new to sites and customer portals.

 

I have my site created and associated to a customer portal.  I've modified the standard VF page for site login to skin it with my corporat branding.

 

What Im looking for is some guidance on is if there is a standard customer portal controller I can use, and simply customize VF page to run it.  I would like to continue my branding into the portal and make use of all the standard portal functionality, security, and data rights I have setup.  All I want to do is create a VF page for the portal, to use my branding, and make use of a standard controller for the CP. 

 

Does one exist, any code samples exist out there?

 

Thanks 

Do any of you know a way to see any statistics on the number of times my Apex classes have been called?  Trying to get a feel for how often some of the customizations we've implemented are being used, getting to an ROI for our development time.

 

Dashboards would be great, but would settle for any kind of stats on number of calls...

 

Thanks

Hoping somebody can help me here. Im trying to assign a value to a variable in an Apex Class from a field in a custom object.  I'll use this variable later on in the class to shift some due dates.

 

My problem is that the field is defined as a double, and I need to cast it to an integer in order to do my calculations.

 

I have the following code, that gives me this error when attempting to save it.

 

Illegal Assignment from Schema.SObjectField to Double

 

Code snippet

 

private final ApexPages.StandardController controller; public CustomController(ApexPages.StandardController controller){ this.controller = controller; myProject = (Project_KA__c)controller.getRecord(); Double y = [select ShiftByDays__c from Project_KA__c where Id = :myProject.Id]; Integer shiftby = y.intValue(); }

 

 Any ideas as to why the invValue is not casting this, or why Im getting the Illeagle Assignmet error?

 

Im receiving the following error when attempting to save the following VisualForce page.  Does anybody have any suggestions?  Im stumped.

 

Thanks in advance

 

 VF Page

 

 

<apex:page controller="editNewProjectExt" sidebar="false" showheader="false"> <apex:form > <apex:pageBlock title="Edit new project information" id="newproj" mode="edit"> <apex:pageBlockSection columns="2"> <apex:outputLabel value="Project Name"/> <apex:inputField value="{!myProject.Name}"/> <apex:outputLabel value="Account" /> <apex:inputField value="{!myProject.Account__c}" /> <apex:outputLabel value="Original Completion Date" for="OCDInput"/> <apex:inputField id="OCDInput" value="{!myProject.Original_Completion_Date__c}"/> </apex:pageBlockSection> <apex:pageBlockButtons > <apex:commandButton action="{!saveChanges}" value="Save" /> <apex:commandButton action="{!getupdCaseList}" value="Update Cases" /> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

 Controller

 

public class editNewProjectExt{ Project_KA__c myProject; integer dayOffset = 0; date OCD=date.Today(); // Orginal completion date of new project date TCD=date.Today(); // Target completion date of new project, stores the user input from VF page on new orginal completion date List<Case> myCaseList; private final ApexPages.StandardController controller; public editNewProjectExt(ApexPages.StandardController controller){ this.controller = controller; myProject = (Project_KA__c)controller.getRecord(); myProject = [select Id, Name, Account__c, Target_Completion_Date__c, Original_Completion_Date__c from Project_KA__c where Id = :myProject.Id]; } // Getter public Project_KA__c getmyProject() { return myProject; } // Save method public pagereference saveChanges() { // myProject.Original_Completion_Date__c=OCDVF.Original_Completion_Date__c; update myProject; PageReference pageRef = new PageReference('/' + myProject.Id); pageRef.setRedirect(true); List<Case> myCaseList = getupdCaseList(); return pageRef; } // Calc new days public List<Case> getupdCaseList(){ if(myProject.Id<>Null){ myCaseList = [select Id, Date_Du__c, Internal_Date_Due__c from Case where Project__c = :myProject.Id]; // Set date veriables OCD= myProject.Original_Completion_Date__c; TCD= myProject.Target_Completion_Date__c; OCD=date.Today(); // loop through and update case details system.debug('OCD = '+OCD); system.debug('TCD = '+TCD); dayOffset = OCD.daysBetween(TCD); system.debug(dayOffset); for(Case myCaseListItem:myCaseList) { Case newCase = myCaseListItem; newCase.Date_Du__c = myCaseListItem.Date_Du__c + dayOffset; newCase.Internal_Date_Due__c = myCaseListItem.Internal_Date_Due__c + dayOffset; upsert newCase; } //for loop } // myClaseList select return null; // do not return anythign out of this method PageReference('/?id='+myProject.Id); } // getmyCalseList method } // For the class

 

 

 

 

 

 

 

I have a slight dilemma that Im hoping you call all help me with.  I have a need to call a method from another method, but am not sure how to do so. 

I need the save method to update my custom object before I can have the getupdClaseList method execute successfully.  Both are in the same class, as an extension the controller on a VisualFoce page. 

 

What I would like to happen is that the getupdCaseList method is called after the user clicks the save button (Save method).


Any ideas/tips?

 

 Save method

 

// Save method public pagereference saveChanges() { update myProject; //return null; PageReference pageRef = new PageReference('/apex/editNewProject?id='+myProject.Id); pageRef.setRedirect(true); return pageRef; }

 

 getupdCaselList Method

 

// Calc new days public List<Case> getupdCaseList(){ if(myProject.Id<>Null){ myCaseList = [select Id, Date_Du__c, Internal_Date_Due__c from Case where Project__c = :myProject.Id]; // Set date veriables OCD= myProject.Original_Completion_Date__c; TCD= myProject.Target_Completion_Date__c; // loop through and update case details system.debug(OCD); system.debug(TCD); dayOffset = OCD.daysBetween(TCD); system.debug(dayOffset); for(Case myCaseListItem:myCaseList) { Case newCase = myCaseListItem; newCase.Date_Du__c = myCaseListItem.Date_Du__c + dayOffset; newCase.Internal_Date_Due__c = myCaseListItem.Internal_Date_Due__c + dayOffset; upsert newCase; } //for loop } // myClaseList select return null; } // getmyCalseList method

 

 

 

 

 

Greetings,

 

Hoping that somebody has seen this or knows what Im doing wrong.  

 

I have a ViaualFoce page that opens based on a custom button.  My desire is that after a user has entered all the necessary info on this VF page, they click save and the page closes.  For whatever reason the page will not work in the way.  If the user clicks on the custom button to launch the page and then edits/enters any information on the page, the save button will not fire the windows.top.close.  Although, if the user doesn't do anything on the page, the windows.top.close does work and the page closes.

 

Any suggestions?

 

VF Page

 

<apex:page standardController="Case" sidebar="false" showheader="false"> <STYLE type="text/css"> .labelCol { text-align: right } .dataCol { text-align: left } </STYLE> <!-- <apex:sectionHeader title="Add Project Case"/> --> <apex:form > <apex:pageBlock title="Add Project Case" id="thePageBlock" mode="edit"> <apex:pageMessages /> <apex:pageBlockButtons > <!-- <apex:commandButton value="Save" action="{!save}" /> --> <apex:commandButton action="{!save}" value="Save" rerender="AJAXTest" status="AJAXStatus" /> <apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" ID="AJAXStatus" /> <apex:commandButton value="Delete" action="{!delete}" /> </apex:pageBlockButtons> <apex:pageBlockSection title="Basic Information" columns="1"> <apex:inputField value="{!Case.Subject}" required="true" /> <apex:inputField value="{!case.Date_Du__c}" required="true" /> </apex:pageBlockSection> <apex:pageBlockSection title="Case Owners" columns="1"> <apex:outputLabel value="Case Owner" styleClass="labelCol" for="cao" /> <apex:inputField value="{!Case.ownerID}" styleClass="dataCol" /> <apex:outputLabel value="Client Owner" styleClass="labelCol" for="clio" /> <apex:inputField value="{!Case.contactId}" styleClass="dataCol" id="clio" /> <apex:outputLabel value="KA Internal Owner" styleClass="labelCol" for="iio" /> <apex:inputField value="{!Case.Internal_Owner__c}" styleClass="dataCol" id="iio" /> </apex:pageBlockSection> <apex:pageBlockSection title="Additional Information" columns="1"> <apex:inputField value="{!Case.Internal_Date_Due__c}" /> <apex:inputField value="{!Case.Status}" /> <apex:inputField value="{!Case.Description}" style="width:800px; height: 100px"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

Hello all,

 

I've been beating my head against the wall with this one for a while, hoping somebody out there can help. I have a simple page that lists out a set of cases related to a project (Project is a custom object). When this VisuaForce page displays if the browser window is maximized all looks great, but if the windows has been resized the fields on the right side of my datatable are rendering outside of the standard SalesForce section graphics.

 

See screen shot

http://www.mtmlearning.com/images/viewcase.jpg

 

Any suggestions?

 

VF Page

 

<apex:page standardController="Project_KA__c" showHeader="false" sidebar="false" extensions="CustomController" standardStylesheets="true"> <style type="text/css"> .dateFormat { display: none; } </style> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton action="{!saveChanges}" value="Save Changes" rerender="AJAXTest" status="AJAXStatus" /> <apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" ID="AJAXStatus" /> </apex:pageBlockButtons> <apex:pageBlockSection title="Quick edit case list"> <apex:dataTable value="{!relatedCases}" var="CC" styleClass="list"> <apex:column headerValue="Action"> <apex:commandLink value="View" action="{!viewCase}"> <apex:param name="caseId" value="{!CC.Id}"/> </apex:commandLink> </apex:column> <apex:column headerValue="Action"> <apex:commandLink value="Edit" action="{!editCase}"> <apex:param name="caseId" value="{!CC.Id}"/> </apex:commandLink> </apex:column> <apex:column headerValue="Case#"> <apex:inputField value="{!CC.CaseNumber}" /> </apex:column> <apex:column headerValue="Subject"> <apex:inputField value="{!CC.Subject}" /> </apex:column> <apex:column headerValue="Status"> <apex:inputField value="{!CC.Status}" /> </apex:column> <apex:column headerValue="Due Date"> <apex:inputField value="{!CC.Date_Du__c}" /> </apex:column> <apex:column headerValue="Internal Due Date"> <apex:inputField value="{!CC.Internal_Date_Due__c}" /> </apex:column> <apex:column headerValue="Case Owner"> <apex:inputField value="{!CC.OwnerID}" /> </apex:column> <apex:column headerValue="Internal Owner"> <apex:inputField value="{!CC.Internal_Owner__c}" /> </apex:column> <apex:column headerValue="Client Owner"> <apex:inputField value="{!CC.ContactID}" /> </apex:column> </apex:dataTable> </apex:pageBlockSection> </apex:pageBlock> <!-- <div style="float:left;width:73%"> --> <apex:detail id="caseDetail" subject="{!selectedCase.Id}" relatedList="false" title="false"/> <!-- </div> --> </apex:form> </apex:page>

 

 

 

Hello all,

I have a custom object called Projects_ka__c that holds projects.  There is a relationship to Cases, where there can be many cases to one Project.  I have a custom button on the Projects_ka__c layout that launches a VF page "addNewProjectCase" that is simply a very streamlined version of the case page, with only the fields I want completed on it.  

 

What I am trying to do is pass in the Projects_ka__c current record, so that on the save action of my addNewProjectsCase page I can have the project pre-populated.

 

The custom button that launches the VF page has the following code

 

https://na4.salesforce.com/apex/AddNewProjectCaseClean?projid={!Project_KA__c.Id}

 

My thinking is that I can pass the projectId via merge field in the query string, parse it out in the custom controller and pass the value to the VF page to use either on save, or populate a hidden field.

 

It almost works, I get the correct projectid passed to the VF page, but when saving I get an error telling me that the projectId is of invalid type

 

What am I doing wrong? Suggestions?

 

 

 

VF Page

 

<apex:page standardController="case" extensions="CaseExtension" showHeader="false" sidebar="false"> <STYLE type="text/css"> .labelCol { text-align: right } .dataCol { text-align: left } </STYLE> <apex:form> <apex:pageBlock title="Quick Add New Project Case/Task"> <table> <tr> <td><apex:outputLabel styleclass="labelCol" value="Status" for="status" /></td> <td><apex:inputField styleclass="dataCol" value="{!Case.status}" id="status" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Case Owner" for="co" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.ownerID}" id="co" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Internal Due Date" for="idd" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.Internal_Date_Due__c}" id="idd" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Project" for="ProjId" /></td> <td><apex:inputField styleclass="dataCol" value="{!ProjId.q}" id="ProjId" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Subject" for="subject" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.subject}" id="subject" style="width:400px" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Description" for="desc" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.description}" id="desc" style="width:800px; height: 100px" /></td> </tr> </table> <apex:commandButton action="{!mysave}" value="Save" rerender="AJAXTest" status="AJAXStatus" /> <apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" ID="AJAXStatus" /> <!-- <apex:commandButton action="{!save}" value="Save Case" /> --> </apex:pageBlock> </apex:form> </apex:page>

 My Custom Controller

 

public class CaseExtension { Case myCase; //string CaseUser; string DefaultStatus; string q; private final ApexPages.StandardController controller; public CaseExtension(ApexPages.StandardController controller){ this.controller = controller; myCase = (Case)controller.getRecord(); myCase.Status = 'Waiting'; myCase.Type = 'Project Task'; myCase.Send_Auto_Acknowledgement__c = False; } public pagereference mysave() { string projid = getProjId(); system.assert( projid != null, ' missing Proj id'); myCase.project__c=projid; insert myCase; return null; } public String getProjId() { String q = ApexPages.currentPage().getParameters().get('projid'); return q; } }

 

Thanks for any suggestions

 

 

 

 

 

I have a custom object called Projects__c that track project related details (ie due dates, owners,....).  A project can have multiple cases assigned to it as well.  I have created a VisualForce page to perform a "quick case add", allowing the user to quickly add a new case for a the project they are viewing.

 

My challenge is that when the custom button is clicked on the projects layout to open my new quick case add VF page, I would like to pass in the current project so that I can save that with the new case they are quickly adding.  This will eliminate the step of having to search for a project on the quick add VF page.

 

Any suggestions (code samples) on how best to achieve this?  Via javascript or custom controller?

 

Here is my quick case add VF page

 

 

<apex:page standardController="case" showHeader="false" sidebar="false"> <STYLE type="text/css"> .labelCol { text-align: right } .dataCol { text-align: left } </STYLE> <apex:form > <apex:pageBlock title="Quick Add New Project Case/Task"> <table> <tr> <td><apex:outputLabel styleclass="labelCol" value="Status" for="status" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.status}" id="status" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Case Owner" for="co" /></td> <td><apex:inputField styleclass="dataCol" value="{!$User.ID}" id="co" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Client Owner" for="clio" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.contactID}" id="clio" /></td> </tr> <!-- add internal owner --> <tr> <td><apex:outputLabel styleclass="labelCol" value="Due Date" for="dd" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.Date_Du__c}" id="dd" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Internal Due Date" for="idd" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.Internal_Date_Due__c}" id="idd" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Project" for="proj" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.Project__c}" id="proj" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Subject" for="subject" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.subject}" id="subject" style="width:400px" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Description" for="desc" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.description}" id="desc" style="width:800px; height: 100px" /></td> </tr> </table> <apex:commandButton action="{!Save}" value="Save" rerender="AJAXTest" status="AJAXStatus" /> <apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" ID="AJAXStatus" /> <!-- <apex:commandButton action="{!save}" value="Save Case" />--> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

I have a VisualFoce page that I've created to perform a quick case add function.  This page is called from a custom object, via button, called Projects__c.  What I would like to do is save my new cases with the userID of the user who is logged in.

 

Can I use the UserInfo.getUserId() method directly in VF or do I need a controller extension to do this?  If so, how do I return the value from the class to the VF page?

 

Thanks

 

 

New to Apex development and looking for some help.  I have added some custom VisualForce pages and Apex code, all of which are working just fine.  I need to deploy this to production but an not sure how to write the necessary test methods

 

The code is rather simply so I have to assume that the test methods will be simple as well.  Any help, code samples would be greatly appreciated.

 

Apex Class

 

public class CustomController{ Project_KA__c myProject; Project_KA__c myProjectDetails; List<Case> relatedCases; public Case selectedCase { get; set; } private final ApexPages.StandardController controller; public CustomController(ApexPages.StandardController controller){ this.controller = controller; myProject = (Project_KA__c)controller.getRecord(); } //Method to return Project details to VF Page public Project_KA__c getProjectDetails(){ myProjectDetails = [select Id, Name, Project_Type__c from Project_KA__c where Id = :myProject.Id]; return myProjectDetails; } //Method to return relatedcases to VF page (MultiCase) public List<Case> getrelatedCases(){ relatedCases = [select Id, CaseNumber, Subject, Status, Date_Du__c, Internal_Date_Due__c, OwnerID from Case where Project__c = :myProject.Id ORDER BY Date_Du__c]; return relatedCases; } }

 Thanks in advance

 

 

I currently have a VisualForce page correctly displaying in a nice list view. After reading some other post I might want to display this page using the enhancedListview functionality.  I like the idea of being able to sort and some of the other rich features of the enhance view.

 

Any suggestions on how to display with out the tab header showing?

 

 

<apex:page standardController="Project_KA__c" showHeader="true" sidebar="false" extensions="CustomController"> <apex:enhancedList type="Project_KA__c" height="350"/> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!saveChanges}" /> <apex:commandButton action="{!cancel}" value="Cancel" /> </apex:pageBlockButtons> <apex:pageBlockSection title="Quick edit case list"> <apex:dataTable value="{!relatedCases}" var="CC" styleClass="list"> <apex:column headerValue="Case Number"> <apex:inputField value="{!CC.CaseNumber}" /> </apex:column> <apex:column headerValue="Subject"> <apex:inputField value="{!CC.Subject}" /> </apex:column> <apex:column headerValue="Status"> <apex:inputField value="{!CC.Status}" /> </apex:column> <apex:column headerValue="Due Date"> <apex:inputField value="{!CC.Date_Du__c}" /> </apex:column> <apex:column headerValue="Internal Due Date"> <apex:inputField value="{!CC.Internal_Date_Due__c}" /> </apex:column> <apex:column headerValue="Owner"> <apex:inputField value="{!CC.OwnerID}" /> </apex:column> </apex:dataTable> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

 Hello all,

 

I have a new VF page that lists a set of related cases to a custom object of Projects.  In the display of the data table, when I display input fields that are dates, SalesForce seems to also by default display the current date in the table just to the right of my date filed. 

 

Is there a way to disable this?

 

VisualForce Page

 

<apex:page standardController="Project_KA__c" showHeader="false"
sidebar="false" extensions="CustomController">
<apex:form >
<apex:pageBlock >

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

<apex:pageBlockSection title="Quick edit case list">
<apex:dataTable value="{!relatedCases}" var="CC" styleClass="list">
<apex:column headerValue="Case Number">
<apex:inputField value="{!CC.CaseNumber}" />
</apex:column>
<apex:column headerValue="Subject">
<apex:inputField value="{!CC.Subject}" />
</apex:column>
<apex:column headerValue="Status">
<apex:inputField value="{!CC.Status}" />
</apex:column>
<apex:column headerValue="Due Date">
<apex:inputField value="{!CC.Date_Du__c}" />
</apex:column>
<apex:column headerValue="Internal Due Date">
<apex:inputField value="{!CC.Internal_Date_Due__c}" />
</apex:column>
<apex:column headerValue="Owner">
<apex:inputField value="{!CC.OwnerID}" />
</apex:column>
</apex:dataTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

 

 

 

Newbie question, so thanks for any help

 

I have a custom object called Project_ka_c that holds a list of projects.  Related to this object is the Cases object, where you can have multiple cases for each project.

 

Im trying to develop a custom VF page that will list, for a given project, all the related cases.

 

Have the following VF page

 

<apex:page standardController="project_ka__c" showHeader="false"
    sidebar="false" extensions="CustomController">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection title="Projects Cases">
                <apex:dataTable value="{!CustomController}" var="CC"
                    styleClass="list">
                    <apex:column value="{!CC.ID}" />
                    <apex:column headerValue="Subject">
                        <apex:inputField value="{!CC.Subject}" />
                    </apex:column>
                    <apex:column headerValue="Due Date">
                        <apex:inputField value="{!CC.Date_Du__c}" />
                    </apex:column>
                </apex:dataTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

And here is the customcontroler extension

 

public class CustomController{
  Project_KA__c myProject;
  List<Case> relatedCases;
private final ApexPages.StandardController controller;
  public CustomController(ApexPages.StandardController controller){
     this.controller = controller;
     myProject= (Project_KA__c)controller.getRecord();
relatedCases = [select Id, Subject,Date_Du__c from Case where Project__c = :myProject.Id];
   }
}

 

 

I am receiving the following error on the VF page(shown in red above) and am not sure why/how to resolve.

 

Save error: Unknown property 'Project_KA__cStandardController.CustomController'

 

Any assistance would be appreciated.

 

 

 

Newbe so please bare with me.

 

I have a custom object called Projects_ka__c that holds project information.  Each project may have a set of cases associated to them.  I have created a relationship from the cases object to the project objects and all is well.

 

What I am trying to do is extend the projects standard controler to display a list of related cases in a VF page, list style so that I can make quick edites and updates to the cases from the projects page

 

I have created a VF page as such

 

<apex:page standardController="project_ka__c"    extensions="ProjCase">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection title="Projects Cases">
                <apex:dataTable value="{!CaseRecords}" var="CC"
                    styleClass="list">
                    <apex:column value="{!CC.ID}" />
                    <apex:column headerValue="Subject">
                        <apex:inputField value="{!CC.Subject}" />
                    </apex:column>
                    <apex:column headerValue="Due Date">
                        <apex:inputField value="{!CC.Date_Du__c}" />
                    </apex:column>
                </apex:dataTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
   

 

And an associated class/method

 

public class ProjCase {
  Project_KA__c myProject;
  List<Case> relatedCases;
  private final Project_ka__c projObj;
  public ProjCase(ApexPages.StandardController controller) {
    this.projObj = (Project_ka__c)controller.getRecord();
  }

  public Project_ka__c[] getCaseRecords() {

    case[] relatedCases =
      [select Id, Subject,Date_Du__c from Case where Project__c = :myProject.Id];
}
}
   

 

Two issues I seem to be facing (becides my lack of knowledge of Apex/java codeing)

 

1.  How do I ensure that the ProjCase class is using the current project record

2.  When referencing this extension on the VF page, Im receiveng the following error.

 
Save error: Unknown constructor 'ProjCase.ProjCase(ApexPages.StandardController controller)'   
 

 

Any tips, code samples, or advise is welcolmed

 

 

 

 

 

Hi all:

 

I am building a completely customized, authentication-only site. After some work, I've managed to set it up so that users must authenticate, and when they do they're taken to the site's landing page, a custom VF page.

 

The problem is, I still have what I'll call the "customer portal wrapper" around the page -- it has the customer portal CSS, and the tabs for Home, Case, Solutions, Reports, Documents, as well as the sidebar.

 

I want all that to disappear. Basically I want the page to appear exactly as it does when I access it directly in my org.

 

What do I need to turn on or off to accomplish this?

 

Thanks.

  • October 07, 2009
  • Like
  • 0

Hoping somebody can help me here. Im trying to assign a value to a variable in an Apex Class from a field in a custom object.  I'll use this variable later on in the class to shift some due dates.

 

My problem is that the field is defined as a double, and I need to cast it to an integer in order to do my calculations.

 

I have the following code, that gives me this error when attempting to save it.

 

Illegal Assignment from Schema.SObjectField to Double

 

Code snippet

 

private final ApexPages.StandardController controller; public CustomController(ApexPages.StandardController controller){ this.controller = controller; myProject = (Project_KA__c)controller.getRecord(); Double y = [select ShiftByDays__c from Project_KA__c where Id = :myProject.Id]; Integer shiftby = y.intValue(); }

 

 Any ideas as to why the invValue is not casting this, or why Im getting the Illeagle Assignmet error?

 

Im receiving the following error when attempting to save the following VisualForce page.  Does anybody have any suggestions?  Im stumped.

 

Thanks in advance

 

 VF Page

 

 

<apex:page controller="editNewProjectExt" sidebar="false" showheader="false"> <apex:form > <apex:pageBlock title="Edit new project information" id="newproj" mode="edit"> <apex:pageBlockSection columns="2"> <apex:outputLabel value="Project Name"/> <apex:inputField value="{!myProject.Name}"/> <apex:outputLabel value="Account" /> <apex:inputField value="{!myProject.Account__c}" /> <apex:outputLabel value="Original Completion Date" for="OCDInput"/> <apex:inputField id="OCDInput" value="{!myProject.Original_Completion_Date__c}"/> </apex:pageBlockSection> <apex:pageBlockButtons > <apex:commandButton action="{!saveChanges}" value="Save" /> <apex:commandButton action="{!getupdCaseList}" value="Update Cases" /> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

 Controller

 

public class editNewProjectExt{ Project_KA__c myProject; integer dayOffset = 0; date OCD=date.Today(); // Orginal completion date of new project date TCD=date.Today(); // Target completion date of new project, stores the user input from VF page on new orginal completion date List<Case> myCaseList; private final ApexPages.StandardController controller; public editNewProjectExt(ApexPages.StandardController controller){ this.controller = controller; myProject = (Project_KA__c)controller.getRecord(); myProject = [select Id, Name, Account__c, Target_Completion_Date__c, Original_Completion_Date__c from Project_KA__c where Id = :myProject.Id]; } // Getter public Project_KA__c getmyProject() { return myProject; } // Save method public pagereference saveChanges() { // myProject.Original_Completion_Date__c=OCDVF.Original_Completion_Date__c; update myProject; PageReference pageRef = new PageReference('/' + myProject.Id); pageRef.setRedirect(true); List<Case> myCaseList = getupdCaseList(); return pageRef; } // Calc new days public List<Case> getupdCaseList(){ if(myProject.Id<>Null){ myCaseList = [select Id, Date_Du__c, Internal_Date_Due__c from Case where Project__c = :myProject.Id]; // Set date veriables OCD= myProject.Original_Completion_Date__c; TCD= myProject.Target_Completion_Date__c; OCD=date.Today(); // loop through and update case details system.debug('OCD = '+OCD); system.debug('TCD = '+TCD); dayOffset = OCD.daysBetween(TCD); system.debug(dayOffset); for(Case myCaseListItem:myCaseList) { Case newCase = myCaseListItem; newCase.Date_Du__c = myCaseListItem.Date_Du__c + dayOffset; newCase.Internal_Date_Due__c = myCaseListItem.Internal_Date_Due__c + dayOffset; upsert newCase; } //for loop } // myClaseList select return null; // do not return anythign out of this method PageReference('/?id='+myProject.Id); } // getmyCalseList method } // For the class

 

 

 

 

 

 

 

I have a slight dilemma that Im hoping you call all help me with.  I have a need to call a method from another method, but am not sure how to do so. 

I need the save method to update my custom object before I can have the getupdClaseList method execute successfully.  Both are in the same class, as an extension the controller on a VisualFoce page. 

 

What I would like to happen is that the getupdCaseList method is called after the user clicks the save button (Save method).


Any ideas/tips?

 

 Save method

 

// Save method public pagereference saveChanges() { update myProject; //return null; PageReference pageRef = new PageReference('/apex/editNewProject?id='+myProject.Id); pageRef.setRedirect(true); return pageRef; }

 

 getupdCaselList Method

 

// Calc new days public List<Case> getupdCaseList(){ if(myProject.Id<>Null){ myCaseList = [select Id, Date_Du__c, Internal_Date_Due__c from Case where Project__c = :myProject.Id]; // Set date veriables OCD= myProject.Original_Completion_Date__c; TCD= myProject.Target_Completion_Date__c; // loop through and update case details system.debug(OCD); system.debug(TCD); dayOffset = OCD.daysBetween(TCD); system.debug(dayOffset); for(Case myCaseListItem:myCaseList) { Case newCase = myCaseListItem; newCase.Date_Du__c = myCaseListItem.Date_Du__c + dayOffset; newCase.Internal_Date_Due__c = myCaseListItem.Internal_Date_Due__c + dayOffset; upsert newCase; } //for loop } // myClaseList select return null; } // getmyCalseList method

 

 

 

 

 

Hello all,

 

I've been beating my head against the wall with this one for a while, hoping somebody out there can help. I have a simple page that lists out a set of cases related to a project (Project is a custom object). When this VisuaForce page displays if the browser window is maximized all looks great, but if the windows has been resized the fields on the right side of my datatable are rendering outside of the standard SalesForce section graphics.

 

See screen shot

http://www.mtmlearning.com/images/viewcase.jpg

 

Any suggestions?

 

VF Page

 

<apex:page standardController="Project_KA__c" showHeader="false" sidebar="false" extensions="CustomController" standardStylesheets="true"> <style type="text/css"> .dateFormat { display: none; } </style> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton action="{!saveChanges}" value="Save Changes" rerender="AJAXTest" status="AJAXStatus" /> <apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" ID="AJAXStatus" /> </apex:pageBlockButtons> <apex:pageBlockSection title="Quick edit case list"> <apex:dataTable value="{!relatedCases}" var="CC" styleClass="list"> <apex:column headerValue="Action"> <apex:commandLink value="View" action="{!viewCase}"> <apex:param name="caseId" value="{!CC.Id}"/> </apex:commandLink> </apex:column> <apex:column headerValue="Action"> <apex:commandLink value="Edit" action="{!editCase}"> <apex:param name="caseId" value="{!CC.Id}"/> </apex:commandLink> </apex:column> <apex:column headerValue="Case#"> <apex:inputField value="{!CC.CaseNumber}" /> </apex:column> <apex:column headerValue="Subject"> <apex:inputField value="{!CC.Subject}" /> </apex:column> <apex:column headerValue="Status"> <apex:inputField value="{!CC.Status}" /> </apex:column> <apex:column headerValue="Due Date"> <apex:inputField value="{!CC.Date_Du__c}" /> </apex:column> <apex:column headerValue="Internal Due Date"> <apex:inputField value="{!CC.Internal_Date_Due__c}" /> </apex:column> <apex:column headerValue="Case Owner"> <apex:inputField value="{!CC.OwnerID}" /> </apex:column> <apex:column headerValue="Internal Owner"> <apex:inputField value="{!CC.Internal_Owner__c}" /> </apex:column> <apex:column headerValue="Client Owner"> <apex:inputField value="{!CC.ContactID}" /> </apex:column> </apex:dataTable> </apex:pageBlockSection> </apex:pageBlock> <!-- <div style="float:left;width:73%"> --> <apex:detail id="caseDetail" subject="{!selectedCase.Id}" relatedList="false" title="false"/> <!-- </div> --> </apex:form> </apex:page>

 

 

 

Hello all,

I have a custom object called Projects_ka__c that holds projects.  There is a relationship to Cases, where there can be many cases to one Project.  I have a custom button on the Projects_ka__c layout that launches a VF page "addNewProjectCase" that is simply a very streamlined version of the case page, with only the fields I want completed on it.  

 

What I am trying to do is pass in the Projects_ka__c current record, so that on the save action of my addNewProjectsCase page I can have the project pre-populated.

 

The custom button that launches the VF page has the following code

 

https://na4.salesforce.com/apex/AddNewProjectCaseClean?projid={!Project_KA__c.Id}

 

My thinking is that I can pass the projectId via merge field in the query string, parse it out in the custom controller and pass the value to the VF page to use either on save, or populate a hidden field.

 

It almost works, I get the correct projectid passed to the VF page, but when saving I get an error telling me that the projectId is of invalid type

 

What am I doing wrong? Suggestions?

 

 

 

VF Page

 

<apex:page standardController="case" extensions="CaseExtension" showHeader="false" sidebar="false"> <STYLE type="text/css"> .labelCol { text-align: right } .dataCol { text-align: left } </STYLE> <apex:form> <apex:pageBlock title="Quick Add New Project Case/Task"> <table> <tr> <td><apex:outputLabel styleclass="labelCol" value="Status" for="status" /></td> <td><apex:inputField styleclass="dataCol" value="{!Case.status}" id="status" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Case Owner" for="co" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.ownerID}" id="co" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Internal Due Date" for="idd" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.Internal_Date_Due__c}" id="idd" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Project" for="ProjId" /></td> <td><apex:inputField styleclass="dataCol" value="{!ProjId.q}" id="ProjId" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Subject" for="subject" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.subject}" id="subject" style="width:400px" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Description" for="desc" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.description}" id="desc" style="width:800px; height: 100px" /></td> </tr> </table> <apex:commandButton action="{!mysave}" value="Save" rerender="AJAXTest" status="AJAXStatus" /> <apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" ID="AJAXStatus" /> <!-- <apex:commandButton action="{!save}" value="Save Case" /> --> </apex:pageBlock> </apex:form> </apex:page>

 My Custom Controller

 

public class CaseExtension { Case myCase; //string CaseUser; string DefaultStatus; string q; private final ApexPages.StandardController controller; public CaseExtension(ApexPages.StandardController controller){ this.controller = controller; myCase = (Case)controller.getRecord(); myCase.Status = 'Waiting'; myCase.Type = 'Project Task'; myCase.Send_Auto_Acknowledgement__c = False; } public pagereference mysave() { string projid = getProjId(); system.assert( projid != null, ' missing Proj id'); myCase.project__c=projid; insert myCase; return null; } public String getProjId() { String q = ApexPages.currentPage().getParameters().get('projid'); return q; } }

 

Thanks for any suggestions

 

 

 

 

 

Collective wisdom please!

 

I have a managed package (say MyPackageName) installed in a dev org, which contains a page controller (say MyPackagedPageController) and i am having 2 problems:

 

Firstly:

If i try to use the package's page controller for a VF page, it works fine e.g. controller="MyPackageName.MyPackagedPageController".

However, if i try to include an extension in the VF page that is not found in the package (say MyExtension) e.g. extensions="MyExtension",

when i try click on a button on the VF page that is supposed to refresh the page (an apex function returning a page reference) I get the error:"Apex class 'MyPackageName.MyExtension' does not exist"

 

Secondly:

If i simply try and have a page controller (say MySeparatePageController) for the VF page e.g. controller="MySeparatePageController", I get an error when i just try and save the VF page saying during development simply saying: "Error: Index: 0"

 

Any thoughts please?!

 

M

Message Edited by mt0859 on 06-22-2009 02:33 PM

I have a custom object called Projects__c that track project related details (ie due dates, owners,....).  A project can have multiple cases assigned to it as well.  I have created a VisualForce page to perform a "quick case add", allowing the user to quickly add a new case for a the project they are viewing.

 

My challenge is that when the custom button is clicked on the projects layout to open my new quick case add VF page, I would like to pass in the current project so that I can save that with the new case they are quickly adding.  This will eliminate the step of having to search for a project on the quick add VF page.

 

Any suggestions (code samples) on how best to achieve this?  Via javascript or custom controller?

 

Here is my quick case add VF page

 

 

<apex:page standardController="case" showHeader="false" sidebar="false"> <STYLE type="text/css"> .labelCol { text-align: right } .dataCol { text-align: left } </STYLE> <apex:form > <apex:pageBlock title="Quick Add New Project Case/Task"> <table> <tr> <td><apex:outputLabel styleclass="labelCol" value="Status" for="status" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.status}" id="status" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Case Owner" for="co" /></td> <td><apex:inputField styleclass="dataCol" value="{!$User.ID}" id="co" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Client Owner" for="clio" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.contactID}" id="clio" /></td> </tr> <!-- add internal owner --> <tr> <td><apex:outputLabel styleclass="labelCol" value="Due Date" for="dd" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.Date_Du__c}" id="dd" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Internal Due Date" for="idd" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.Internal_Date_Due__c}" id="idd" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Project" for="proj" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.Project__c}" id="proj" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Subject" for="subject" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.subject}" id="subject" style="width:400px" /></td> </tr> <tr> <td><apex:outputLabel styleclass="labelCol" value="Description" for="desc" /></td> <td><apex:inputField styleclass="dataCol" value="{!case.description}" id="desc" style="width:800px; height: 100px" /></td> </tr> </table> <apex:commandButton action="{!Save}" value="Save" rerender="AJAXTest" status="AJAXStatus" /> <apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" ID="AJAXStatus" /> <!-- <apex:commandButton action="{!save}" value="Save Case" />--> </apex:pageBlock> </apex:form> </apex:page>

 

 

 

I have a VisualFoce page that I've created to perform a quick case add function.  This page is called from a custom object, via button, called Projects__c.  What I would like to do is save my new cases with the userID of the user who is logged in.

 

Can I use the UserInfo.getUserId() method directly in VF or do I need a controller extension to do this?  If so, how do I return the value from the class to the VF page?

 

Thanks

 

 

New to Apex development and looking for some help.  I have added some custom VisualForce pages and Apex code, all of which are working just fine.  I need to deploy this to production but an not sure how to write the necessary test methods

 

The code is rather simply so I have to assume that the test methods will be simple as well.  Any help, code samples would be greatly appreciated.

 

Apex Class

 

public class CustomController{ Project_KA__c myProject; Project_KA__c myProjectDetails; List<Case> relatedCases; public Case selectedCase { get; set; } private final ApexPages.StandardController controller; public CustomController(ApexPages.StandardController controller){ this.controller = controller; myProject = (Project_KA__c)controller.getRecord(); } //Method to return Project details to VF Page public Project_KA__c getProjectDetails(){ myProjectDetails = [select Id, Name, Project_Type__c from Project_KA__c where Id = :myProject.Id]; return myProjectDetails; } //Method to return relatedcases to VF page (MultiCase) public List<Case> getrelatedCases(){ relatedCases = [select Id, CaseNumber, Subject, Status, Date_Du__c, Internal_Date_Due__c, OwnerID from Case where Project__c = :myProject.Id ORDER BY Date_Du__c]; return relatedCases; } }

 Thanks in advance

 

 

Newbie question, so thanks for any help

 

I have a custom object called Project_ka_c that holds a list of projects.  Related to this object is the Cases object, where you can have multiple cases for each project.

 

Im trying to develop a custom VF page that will list, for a given project, all the related cases.

 

Have the following VF page

 

<apex:page standardController="project_ka__c" showHeader="false"
    sidebar="false" extensions="CustomController">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection title="Projects Cases">
                <apex:dataTable value="{!CustomController}" var="CC"
                    styleClass="list">
                    <apex:column value="{!CC.ID}" />
                    <apex:column headerValue="Subject">
                        <apex:inputField value="{!CC.Subject}" />
                    </apex:column>
                    <apex:column headerValue="Due Date">
                        <apex:inputField value="{!CC.Date_Du__c}" />
                    </apex:column>
                </apex:dataTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

And here is the customcontroler extension

 

public class CustomController{
  Project_KA__c myProject;
  List<Case> relatedCases;
private final ApexPages.StandardController controller;
  public CustomController(ApexPages.StandardController controller){
     this.controller = controller;
     myProject= (Project_KA__c)controller.getRecord();
relatedCases = [select Id, Subject,Date_Du__c from Case where Project__c = :myProject.Id];
   }
}

 

 

I am receiving the following error on the VF page(shown in red above) and am not sure why/how to resolve.

 

Save error: Unknown property 'Project_KA__cStandardController.CustomController'

 

Any assistance would be appreciated.