-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
12Questions
-
21Replies
Is it possible to disable the requirement of fields based on which commandButton is pressed?
Is there a quick way to disable a field as required based on what action button is pressed? ie if you have this:
<apex:inputCheckbox value="{!confirmTerms}" required="true"/> <apex:commandButton action="{!confirm}" value="Confirm" id="confirm" /> <apex:commandButton action="{!secondConfirm}" value="secondConfirm" id="secondConfirm" />
put something in the required to check for the button eg something like this?:
<apex:inputCheckbox value="{!confirmTerms}" required="{!if($CurrentPage.parameters.action.confirm == true,true,false)}"/> <apex:commandButton action="{!confirm}" value="Confirm" id="confirm" /> <apex:commandButton action="{!secondConfirm}" value="secondConfirm" id="secondConfirm" />
-
- Radnip
- November 08, 2011
- Like
- 0
- Continue reading or reply
Options for a table to show static data/checkmarks
I need to create a table that has option names going down the side with columns with check boxes (not fields but images could be bullets) to show that the options go with the packages that are going across the top. This will contain no field data just informational. Similar to this. http://www.salesforce.com/crm/editions-pricing.jsp But instead of the the options being in each column they would be down the side. And obviously not as tricked out as SF site. LOL. Anyone have some shell code, I can add too or tweak.
-
- Melliott
- November 08, 2011
- Like
- 0
- Continue reading or reply
Help with getting a field
I have an object off called release that is a child to the account and to the opportunity. The button envokes the VF page from the opportunity and passes the opportunityid to the page on the object release. How the heck can I fill in the account field on release with the opportunity account. Driving me batty. Here is my custom controller.
public with sharing class RequestController { // steps public String requesttype {get {return 'Request';}} public String requestproduct {get {return 'Request Product';}} public String step {get; set;} public String step2 {get; set;} public RFP_Request__c Request {get; set;} // return URL private String retUrl; public RequestController() { step = requesttype; step2 = requestproduct; ID OpportunityId = ApexPages.currentPage().getParameters().get('OpportunityId'); Request = new RFP_Request__c(Opportunity__c = OpportunityId); // i know it needs to go here but how the heck do I map it... if (OpportunityId!= null) retUrl = '/' + OpportunityId; } public PageReference cancel() { if (retUrl != null) return new PageReference(retUrl); else return null; } public PageReference save() { upsert request ; return null; } public PageReference step1() { // show step 1 page return Page.requesttype; } public PageReference step2() { logic here } else return Page.requestproduct; } public PageReference step3() {//lots of logic here } private Boolean isRequestValid() { if (Request.RFP_Request__c == false && Request.RFC_Request__c == false && Request.Training_Request__c == false && Request.Service_Request__c == false ) return false; else return true; } }
-
- Melliott
- November 07, 2011
- Like
- 0
- Continue reading or reply
Mutli - Select Picklist values not rerendering page
I have a multi select picklist that rerenders sections of a page. It currently only works if one value is selected. How do I get it to work if two values are selected.
Here is a section of the page.
<apex:pageBlockSection title="ED Experience" id="ED" columns="1" rendered="{!isFT}" > <apex:OutputText style="font-size: larger; font-weight: bold;" value="Please provide a brief summary of your Emergency Department experience."/> <apex:inputField value="{!application.ED_Experience__c}"/> </apex:pageBlocksection> <apex:pageBlockSection title="Emergency Department Physician's Certification of Competency" id="CTED" columns="1" rendered="{!isFT}">
Here is the pertinent pieces of the controller
private Set<String> EDtypes = new Set<String> {'ED Full Time', 'ED Part Time'}; private Set<String> Midtypes = new Set<String> {'Fast Track Full Time','Fast Track Part Time','Clinic Part Time','Clinic Full Time'}; private Set<String> EDMidtypes = new Set<String> {'ED Full Time', 'ED Part Time','Fast Track Full Time','Fast Track Part Time','Clinic Part Time','Clinic Full Time'}; private Set<String> Hosptypes = new Set<String> {'Hospitalist Full Time','Hospitalist Part Time'}; public Boolean getIsFT () { return EDtypes.contains(application.Practice_Preference__c); } public Boolean getIsFTMID () { return EDMidtypes.contains(application.Practice_Preference__c); } public Boolean getIsMid() { return Midtypes.contains(application.Practice_Preference__c); }
I tried changing IsFT to IsFTMid in the VF page but it does not render when both ED Full time and Clinic Full Time (for example) are selected. Any help is greatly appreciated.
-
- Melliott
- November 16, 2010
- Like
- 0
- Continue reading or reply
Sites Forgot Password Page is not working
I have a site that I we have created that the forgot password link is not working. When you put in the username and click submit, it just sits there. The ForgotPassword Confirm page does not display nor does the email get sent. This is the standard Forgot Password pages and controller that was built when the site was created so they are standard pages.
Any help is greatly appreciated. This is an urgent project we are trying to roll and it's driving me insane.
Code for the page is here.
<apex:page id="Registration" showHeader="false" controller="ForgotPasswordController" title="{!$Label.site.forgot_password}"> <apex:stylesheet value="{!URLFOR($Resource.CP_Site_Resources, 'main.css')}"/> <apex:composition template="CPSiteTemplate"> <apex:define name="body"> <div id="mainouter"> <div id="maininner" align="center"> <apex:form id="theForm" forceSSL="true"> <apex:panelGrid columns="2" style="margin-top:1em;"> <apex:outputLabel value="{!$Label.site.username}" for="username"/> <apex:inputText required="true" id="username" value="{!username}"/> <apex:commandButton id="submit" value="{!$Label.site.submit}" action="{!forgotPassword}"/> </apex:panelGrid> </apex:form> <!-- Closing maininner Div here --> </div> <!-- closing mainouter Div here --> </div> </apex:define> </apex:composition> </apex:page>
/** * An apex page controller that exposes the site forgot password functionality */ public class ForgotPasswordController { public String username {get; set;} public ForgotPasswordController() {} public PageReference forgotPassword() { boolean success = Site.forgotPassword(username); PageReference pr = Page.ForgotPasswordConfirm; pr.setRedirect(true); system.debug(success); if (success) { return pr; } return null; } public static testMethod void testForgotPasswordController() { // Instantiate a new controller with all parameters in the page ForgotPasswordController controller = new ForgotPasswordController(); controller.username = 'test@salesforce.com'; System.assertEquals(controller.forgotPassword(),null); } }
-
- Melliott
- October 29, 2010
- Like
- 0
- Continue reading or reply
Help with Date Calculation Formula Field
-
- Melliott
- August 09, 2009
- Like
- 0
- Continue reading or reply
Help with Rendering a Visual Force Page
-
- Melliott
- November 18, 2008
- Like
- 0
- Continue reading or reply
Visualforce Email Templates - Input Field Help
-
- Melliott
- November 14, 2008
- Like
- 0
- Continue reading or reply
Help - Beginner with Visual Force Here
-
- Melliott
- June 30, 2008
- Like
- 0
- Continue reading or reply
Workflow Task Creation Page Layout
-
- Melliott
- April 16, 2008
- Like
- 0
- Continue reading or reply
Help with Hyperlink Code
-
- Melliott
- October 01, 2007
- Like
- 0
- Continue reading or reply
Web to Opportunity/Product or Custom Tab?
-
- Melliott
- October 21, 2005
- Like
- 0
- Continue reading or reply
Forms in an HTML Email Help
-
- Melliott
- October 21, 2005
- Like
- 0
- Continue reading or reply
Role Management
Hi all,
Hope all are doing good, i need some help,
suppose if there two roles like A and B, B is under A
Here the leads created by B can be seen by A , but can we make that leads created by B cannot be edited by A, because of A is superior than B, A can see B's leads, but here in my case A should not edit the leads created by B ,what to do in this case.
Please send me the details.
- shiva krishna
- November 16, 2011
- Like
- 0
- Continue reading or reply
Salesfoce to Salesforce
Hi,
Does anyone know if Salesforce to Salesforce can be configured for same organization. In other words, pubilsh production data and subscribe that to QA or full-copy sandbox for same organization.
Thanks in advance!
- avtopi786
- November 16, 2011
- Like
- 0
- Continue reading or reply
Trigger - Update Fields
Hello - I am trying to update fields on thje opportunitylineitem from the Product whe a rep selects a specific product.
I have the following code but its not updating? Please help!
trigger UpdateOpportunityProductFields on OpportunityLineItem (before insert, before update){ { for(OpportunityLineItem myOLI:trigger.new) { if(myOLI.Product_Family__c == 'Resume Search') { myOLI.Views__c = myOLI.PriceBookEntry.Product2.Views__c; myOLI.Term_Days__c = myOLI.PriceBookEntry.Product2.Term_Days__c; myOLI.Daily_View_Limit__c = myOLI.PriceBookEntry.Product2.Daily_View_Limit__c; } } } }
Cheers,
Niki
- NikiG22
- November 15, 2011
- Like
- 0
- Continue reading or reply
Validating a new child object against existing ones.
Hello. First post so please be gentle.
I have a custom object (Codes) with 2 fields in it, a picklist and a free text field. The picklist has 9 possible values in it. There is a master detail relationship between the Account (Master) and the CustomObject (Detail) and they are shown on the Account view as a related list. In order to add a new one the user simply clicks 'new', selects the type from the list and adds a code in the free text and clicks save. All of this is fine but now I need to add a business rule.
Rule: One Account cannot have more than one code for a selected code type.
I am trying to approach this using a validation rule on the detail object on save. I have been told that is could be possible to use a VLOOKUP or something. I need to check the selected code type against existing detail objects for that master to make sure it hasn't already been allocated a code.
Any help would be fantastic and very much appreciated.
Thanks in advance.
Tom.
- kruelintent
- November 15, 2011
- Like
- 0
- Continue reading or reply
Workflow Rules Order of Execution Change
Hi,
We have 2 workflow. First workflow send an email if value of one field(say Amount) is greater than 50 and second workflow update Amount field to 0 in some condition.
Now the problem is if one user put the value 60 and hit the save button then email will be fired, but due to second workflow Amount value will 0.
When Amount value is 0 email should not be fired. I need a solution where 2nd workflow should always run first then first workflow should run.
Can somebody help me on this
- Vinod Tomar
- November 15, 2011
- Like
- 0
- Continue reading or reply
Initial VF page load time is either too long or it times out
Hi all,
I'm having a problem with a visualforce page that I've developed. The initial load either times out or it takes over 30 secs. After the page has loaded though, it takes less than a sec to reload the same page. My first thought was to check the view state size of the page, which is about 20K. I can optimize the view state size of the page later if needed, but at 20K, I didn't think this could be the culprit.
I'd post my VF page/Apex controller, but they are very long so I'll try to walk through the code:
Controller
- Within its constructor, I perform 5 total queries: one SOQL to get some custom fields from the current user, one SOQL to get the profile name of the current user, one SOSL to get all the users within a certain criteria (I use the LIKE operator in it), one SOQL to search events and the last one to get tasks.
- I really don't like the fact that I'm running 5 queries within the constructor. But I wasn't sure how I could refractor them to help the load issue.
VF page
- There are three main components: one block that allows users to use a custom search, one block that shows their events and the last block that shows their tasks.
- One thing that I do within the page is to use the data from the controller extensively. For example:
<apex:column width="20%" styleClass="custTableClass"> <apex:facet name="header"> <apex:outputText value="Description"/> </apex:facet> <div id="desc{!e.evt.Id}_{!e.evt.ActivityDate}"> <apex:outputField value="{!e.evt.Description}"/> </div></apex:column>
I use jquery to apply row coloring and such on a pageBlockTable, so I wrap apex components within a div tag so that I pass the event's id and date as part of the id attribute. I use this technique extensively within my page, so I didn't know if this could have any impact on page load.
Let me know if I need to provide any further info. And sorry for the long post.
Thanks!
- J&A
- November 08, 2011
- Like
- 0
- Continue reading or reply
How do I revert to the Standard SF Pages once i've gone live with my custom Visual force pages?
Hello,
I'm having trouble reverting back to the standard salesforce pages (record view & edit screen) is there possiblly a quick step-by-step guide i could use? I've tried and Internet Explorer is not showing the standard pages when i click the edit button. Any help is greatly appreciated. Thank you in advance! - Jeremy
- Knowledgeseeker
- November 08, 2011
- Like
- 0
- Continue reading or reply
Displaying tables on VF page..pls help..
I need to include a table on my visualforce page and query the data from the custom objects already developed in Salesforce application. while browsing over the internet, i came thru some controller class example and need to write a visualforce page for that.. I tailored the class shown below as per my requirements, but couldn't write code for the page..Could someone help me in this issue..? total columns to display would be 10.
Its prime urgent and I'm running out of time..
public class OpportunityLineItemsController {
Public List<OpportunityLineItems> LineItems = new List<OpportunityLineItems>();
public List<OpportunityLineItems> getLineItems() {
LineItems =[select id from OpportunityLineItem limit 10];
return LineItems;
}
Secondly:
When i save the below page, it thorws an error.
Save Error:Unknown property 'Billing_Close__cStandardController.Save'..why is this occuring..?
<apex:page standardController="Billing_Close__c" showheader="false" sidebar="false">
<apex:sectionHeader title="Billing Close Edit" subtitle="New Billing Close" />
<apex:form>
<apex:pageBlock title="Billing Close Edit">
<apex:pageBlockButtons>
<apex:commandButton action="{!Save}" value="Save" />
<apex:commandButton action="{!Save&New}" value="SaveAndNew" />
<apex:commandButton action="{!Cancel}" value="Cancel" />
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>
.
.
Your help is greatly appreciated.. thanks.
- cloudcodernew
- November 08, 2011
- Like
- 0
- Continue reading or reply
Is it possible to disable the requirement of fields based on which commandButton is pressed?
Is there a quick way to disable a field as required based on what action button is pressed? ie if you have this:
<apex:inputCheckbox value="{!confirmTerms}" required="true"/> <apex:commandButton action="{!confirm}" value="Confirm" id="confirm" /> <apex:commandButton action="{!secondConfirm}" value="secondConfirm" id="secondConfirm" />
put something in the required to check for the button eg something like this?:
<apex:inputCheckbox value="{!confirmTerms}" required="{!if($CurrentPage.parameters.action.confirm == true,true,false)}"/> <apex:commandButton action="{!confirm}" value="Confirm" id="confirm" /> <apex:commandButton action="{!secondConfirm}" value="secondConfirm" id="secondConfirm" />
- Radnip
- November 08, 2011
- Like
- 0
- Continue reading or reply
Help with getting a field
I have an object off called release that is a child to the account and to the opportunity. The button envokes the VF page from the opportunity and passes the opportunityid to the page on the object release. How the heck can I fill in the account field on release with the opportunity account. Driving me batty. Here is my custom controller.
public with sharing class RequestController { // steps public String requesttype {get {return 'Request';}} public String requestproduct {get {return 'Request Product';}} public String step {get; set;} public String step2 {get; set;} public RFP_Request__c Request {get; set;} // return URL private String retUrl; public RequestController() { step = requesttype; step2 = requestproduct; ID OpportunityId = ApexPages.currentPage().getParameters().get('OpportunityId'); Request = new RFP_Request__c(Opportunity__c = OpportunityId); // i know it needs to go here but how the heck do I map it... if (OpportunityId!= null) retUrl = '/' + OpportunityId; } public PageReference cancel() { if (retUrl != null) return new PageReference(retUrl); else return null; } public PageReference save() { upsert request ; return null; } public PageReference step1() { // show step 1 page return Page.requesttype; } public PageReference step2() { logic here } else return Page.requestproduct; } public PageReference step3() {//lots of logic here } private Boolean isRequestValid() { if (Request.RFP_Request__c == false && Request.RFC_Request__c == false && Request.Training_Request__c == false && Request.Service_Request__c == false ) return false; else return true; } }
- Melliott
- November 07, 2011
- Like
- 0
- Continue reading or reply
Problem using Reports to manage Users
I hope this is the right place to post this question or annoyance. If it is not, please point me in the right direction. We have a custom field on user accounts that people want to update way too often.
I created a report to pull up the users who have this custom label so I can see who's account needs to be changed. What is really annoying me is I can't bring up the users account to modify it from the report. I have tried: User ID, User Name, User Email Address, but no matter what field I try to add I get a view of the user's chatter comments rather than that users actual account so I can easily modify it and go on to the next one.
Is there a user account field I can add to a report where I can open the link and have a view of that user's account, rather than their Chatter page?
Is there something I'm missing here?
- ParallaxView
- October 25, 2011
- Like
- 0
- Continue reading or reply
Question about to use or not a trigger
Hi all,
I have a general question regarding the use of triggers. My problem is the following:
I have to schedule monthly an update over one checkbox field. The problem that I have is that I can't find an elegant solution to calculate the next month "date of update" because all the formulas I can build are based on TODAY() and, as you may have notice, that changes every day (what a surprise!).
My question is if whether I should use triggers or any other solution for this problem (workflows and update the needed field?)
If I need to create a trigger, do you have any clue on how to? Since the triggers trigger after or before an action happens, I don't have many ideas on how to model this...
Thank you all,
MGA
- magandrez
- October 13, 2011
- Like
- 0
- Continue reading or reply
Help with Rendering a Visual Force Page
- Melliott
- November 18, 2008
- Like
- 0
- Continue reading or reply
Visualforce Email Templates - Input Field Help
- Melliott
- November 14, 2008
- Like
- 0
- Continue reading or reply
trigger batching off of time-based workflow
* changing a field triggers a time-based WF rule, which after an hour
* changes another field on the same object, which
* triggers an apex trigger, which
* changes yet another field
This works fine in general, for small record sets.
However, I just tested it in bulk (by making that first field update to a bunch of records at once), and it failed governor limits (too many DML rows). I didn't expect this, because as far as we the developers can tell, each record is put on the time-workflow queue separately. However, it appears that since I triggered the time WF at the same time for all the records, they all came off the queue at the same time and were batched for trigger processing.
Specifcally, I tried this operation w/ 380 records. It looks like it did one batch of 200 and one batch of 180. So exactly what you'd expect if there was no time WF involved.
But the weird part is: it seems to have batched the records, but not scaled the governor limits to account for it. So in my batch of 200, I got an error message saying: too many DML rows 201. But for a trigger operating on 200 records, the limit for DML rows should be 20k. And I got 200 separate email error messages delivered. So it seems to be treating it as partly a batch, but partly 200 separate operations.
Can someone help with this? Is this how it's meant to work?
Thanks much!
- sparky
- November 06, 2008
- Like
- 0
- Continue reading or reply
SControl in SharePoint 2003 Page Viewer Web Part
We have an SControl which will be used by people who are not SFDC users.
There is a separate authentication procedure (.NET) which uses dedicated SFDC licence. This procedure retrieves SFDC sessionid (through the login call to SFDC Web Service API) and then redirects user to the actual SControl using frontdoor.jsp
When the whole procedure opens in a new browser window everything is fine but if we try to embed the authentication/redirect page within a SharePoint Page Viewer Web Part (which uses an IFrame) then we get redirected to the SFDC login page.
We are experiencing the same problem as this person:
i.e. "The cookie for the user session in asp is not allowed when set in an IFrame from another domain"
Unfortunately enabling cookieless sessions as in the example has not resolved the issue for us.
So does anyone have any ideas on how I can embed the web-service authentication page (.net) and forward to the SControl within a SharePoint web part or IFrame?
Many thanks
Message Edited by VR Developer on 01-21-2008 07:28 AM
- VR Developer
- January 21, 2008
- Like
- 0
- Continue reading or reply
Help with Hyperlink Code
- Melliott
- October 01, 2007
- Like
- 0
- Continue reading or reply
User Context Appex Code is Running
Thanks,
- teddy
- October 01, 2007
- Like
- 0
- Continue reading or reply