• Melliott
  • NEWBIE
  • 25 Points
  • Member since 2005

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

 

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" />



 

  • November 08, 2011
  • Like
  • 0

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.  

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;
  }      
    
    
}

 

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.

 

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); 
    }
}

 

 

 

Is there a way to calculate a specific day of the week of a month for example the Third Tuesday of a month with a formula field.  I can't seem to come up with a way.  I have it on the tip of my tounge and can't spit out the answer. 
I have the basic structure down of doing a visual force page.  I can remove the top bars and the side bars.  I want to render th page in the center of the screen, like a data entry window (pretty format, lol).  Basically when a link is clicked it the window pops up and the user is able to enter the data.
Can Input Text be used in a visualforce email template?  If so how.  It won't let me use apex:form and I can't use an input field with out the apex:form.  Well at least I don't think I can.  Any help would be greatly appreciated.
I have the basic page created.  However, I need to look up a value and return the results in a table.  How do I do that.  I have the look up but it doesn't do anything.
 
Also I saw at a success tour where they turn off the tabs by changing one value, how do I do that.
 
Much appreciate the help.
 
Thanks,
 
Melissa Elliott
The Schumacher Group
I have a workflow that I need a task to be created for however, I need to customize the page layout to include custom task fields as well as update these custom fields with the appropriate data from the object the Task is on.
 
So for example. 
 
I have an object PC which when Amount on Hold is filled in, it will deploy a task to a certain person but I need that task to include the amount on hold field as well as the actual amount on hold data.  Any help will be greatly appreciated.
I need help with a hyperlink formula Here is the code that I have currently HYPERLINK("https://tapp0.salesforce.com/a0w/e?retURL=%2Fa0w%2Fo1N%2Fhome.jsp&00NT0000000mLaW= Group_Number__c ","Create Provider Carrier") Unfortunately, it pulls Group_Number__c into the field instead of the value from the list. This field is on a custom related list on a custom object.
Is it possible to create a form on a web and have it create a new Opportunity or Product. Can it be coded to populate a custom tab. I am looking into options of creating our own e-commerce site using Salesforce.com.
I have a form in an HTML email that will populate into Salesforce when they hit submit. It creates a new record. This forms is sent as a Auto response when a new lead of a certain type is created. I would like to have the form fill in the lead it generated from and not create a new lead. Basically we auto ask for more information. Can this be done? Does someone have the coding for this? Any help is appreciated.

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. 

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!

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

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.

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

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!

 

  • November 08, 2011
  • Like
  • 0

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

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.

 

 

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" />



 

  • November 08, 2011
  • Like
  • 0

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;
  }      
    
    
}

 

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?

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

I have the basic structure down of doing a visual force page.  I can remove the top bars and the side bars.  I want to render th page in the center of the screen, like a data entry window (pretty format, lol).  Basically when a link is clicked it the window pops up and the user is able to enter the data.
Can Input Text be used in a visualforce email template?  If so how.  It won't let me use apex:form and I can't use an input field with out the apex:form.  Well at least I don't think I can.  Any help would be greatly appreciated.
I've set up a situation where:
* 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!
  • November 06, 2008
  • Like
  • 0

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

https://emea.salesforce.com/secur/frontdoor.jsp?sid={session-id-here}&retURL=/servlet/servlet.Integration%3fic=1%26lid=01N200000008nA1

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:

http://community.salesforce.com/sforce/board/message?board.id=NET_development&message.id=1848&query.id=94310

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
I need help with a hyperlink formula Here is the code that I have currently HYPERLINK("https://tapp0.salesforce.com/a0w/e?retURL=%2Fa0w%2Fo1N%2Fhome.jsp&00NT0000000mLaW= Group_Number__c ","Create Provider Carrier") Unfortunately, it pulls Group_Number__c into the field instead of the value from the list. This field is on a custom related list on a custom object.
I was under the impression that Apex Code runs under 'Administrator' Profile and is not affected by the user profile loggedin. I am getting errors from triggers complaining  about  Security settings.  Could any body  help to point out if  my asumptions were wrong or if there is a way to force apex triggeres and classes to run under 'Administrator' Profile?

Thanks,
  • October 01, 2007
  • Like
  • 0