• Kevin042
  • NEWBIE
  • 25 Points
  • Member since 2009

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

Hi there. I was hoping someone could help with this issue. I contacted salesforce support and while they do not support validation rules they did say it can be done (though I have no idea how)

 

I am trying to create an opportunity validation rule on an opportunity so sales people cannot have certain opportunity products on a closed won deal.

 

The reason I am doing this is because we have a number of different line items falling under one product category. Often times early in a deal the sales people do not know specifically which line item it is, so there is a generic one. I dont want an opportunity to be closed won with one of those generic products as the sales person should know by then which specific product it is. 

 

Unfortunately when creating a validation rule I dont have access to opportunity products only pricebooks. I could create a generic pricebook with those generic products in it but I dont know to do that because if a sales person has one generic and one specific, you could add them (because they would be on different pricebooks)

 

So can anyone think of a validation rule that would work or a way around this problem?

 

Thanks in advance for your help!

How can I attach a file to a visualforce email template? 

 

Use Case – we are sending out a visualforce email from the Custom_Object_1__c object and listing info from the related list Child_Object__c.  Now I want to attach to the email any and all files that are listed in the Notes & Attachment related list for Custom_Object_1__c.

 

Thanks,

Kevin

How can I attach a file to a visualforce email template? 

 

Use Case – we are sending out a visualforce email from the Custom_Object_1__c object and listing info from the related list Child_Object__c.  Now I want to attach to the email any and all files that are listed in the Notes & Attachment related list for Custom_Object_1__c.

 

Thanks,

Kevin

I have a simple extention that sums a particular contact field for all contacts of an account.  Here is the method extracted from the extention class:

 

    public AggregateResult getSalesTotal() {
        AggregateResult salesTotal =
            [SELECT SUM(Contact.Num_Orders__c) total
            FROM Contact];
        return salesTotal;

    }

 

Can I access the 'total' field from within Visual force?  I was expecting that {!SalesTotal.total} would work.

 

I know how to get the value within the Apex class method, but would rather pass the whole object and extract the fields using Visualforce.

 

Thanks.

I have a custom formula field (text)

 

Formula is: HYPERLINK("/"& WhatId, "Detail Link")

 

It appears as this clickable link which takes you to the account detail page.

Detail Link

 

Does anyone know if and how I can update the formula so that instead of the static name "Detail Link", it can dynamically update to the Account Name value?


Thanks

  • September 11, 2009
  • Like
  • 0

Hi there. I was hoping someone could help with this issue. I contacted salesforce support and while they do not support validation rules they did say it can be done (though I have no idea how)

 

I am trying to create an opportunity validation rule on an opportunity so sales people cannot have certain opportunity products on a closed won deal.

 

The reason I am doing this is because we have a number of different line items falling under one product category. Often times early in a deal the sales people do not know specifically which line item it is, so there is a generic one. I dont want an opportunity to be closed won with one of those generic products as the sales person should know by then which specific product it is. 

 

Unfortunately when creating a validation rule I dont have access to opportunity products only pricebooks. I could create a generic pricebook with those generic products in it but I dont know to do that because if a sales person has one generic and one specific, you could add them (because they would be on different pricebooks)

 

So can anyone think of a validation rule that would work or a way around this problem?

 

Thanks in advance for your help!

Hi,

 

I've been asked to break down the Amount field of an Opportunity into our different business areas but I'm struggling with how to do it.

 

Each of our products has been marked with the correct Billing Area - Eg. Production, Service etc and I want to Create a field on the Opportunity that just adds up anything in that Opportunity that is marked as Production and then another field to add up anything that is marked as Service but I am really struggling!  I thought it would be simple to do but unless I'm mising something due to the fact it's Friday afternoon I'm really stumped in this one!!

 

Any help or guidance in the right direction would be greatly appreciated.

 

 

Hi Everyone,

 

I am trying to do the following, your help would be much appreciated:

 

 

  • I have a custom field in Product called Origin
  • I have created another custom field in Opportunity Product called Origin
  • When a Product is selected on an Opportunity, I would like to fill the second Origin field with the value of the Origin field from Product.

 

 

I have seen a possible solution using Workflows, however I do not feel this will be workable for the future. I would prefer to use a formula field, unless someone else has a better solution!

 

In a nutshell I want the various custom fields that I have created under Product to be available under Opportunity Product as well.

 

Anyone's swift help would be much appreciated! 

We've created a custom field and picklist that has the different steps in our proposal process. I'd like to create a formula that will mimic the existing stage duration one that is standard in Salesforce.  Does anyone have some direction for me on this?  We have professional I believe (the one under enterprise).

 

Thanks so much!

Hi

 

I am fairly new to Salesforce and very excited about all the opportunities it brings.

 

I am trying to watch some of the Dreamforce '08 videos available in this community site but once I start playing a video it interrupts.

 

It is not like youtube where you start watching a video and the downloading gets ahead very quickly so the video doesn't interrupt.

 

I will really appreciate if someone helps me resolve this.  Watching 5 minutes of a video has become a mission!  I have tried all sorts of tricks:  Security tricks, memory tricks.... and the problem persists.

 

Cheers,

 

David

 

 

Message Edited by Tingo on 03-24-2009 11:30 PM
  • March 25, 2009
  • Like
  • 0
Hello,

I have been trying to get a field on a Visualforce page (the Account ID - a custom field which is a standard lookup) to pre-populate from a query parameter in the url. It does *not* work.

The general use case is that we have a related list on the Account Page for a custom object called Checklist. When we use the standard New button to create a new record, the Account ID is pre-populated on the page since the ID and name are passed in as query parameters.

We had to create a small Visualforce page instead of using the standard page, and overrode the New button. Now when you select New, the page loads without the Account ID pre-populated even though the ID and name are still in the url as query parameters. I took some JavaScript code to pull out those values and have been trying for the past day to figure out how to pass them to the standard controller so it recognizes the Account. The point here is that the end user should not have to re-select the Account from a lookup field when they just came from the Account page.

Since you can't simply View Source on a Visualforce page to see what the field name "{!Checklist__c.Checklist_Template__c}" resolves to (it's just escaped yet not interpreted at that point) I was forced to use a program to view the post request. It would appear that the <apex:inputfield> tag when referring to a lookup actually generates 6 input fields for it.

So... I used those 6 fields, populated them exactly as the lookup field would populate them, and still no luck.
Here is the code:
Code:
<apex:page standardcontroller="Checklist__c" tabstyle="Checklist__c">

  <apex:sectionHeader title="Checklist" subtitle="Create Checklist"/>
  <apex:form id="form1">
    <apex:pageBlock >
  <apex:pageBlockButtons location="top" >
   <apex:commandButton action="{!save}" onclick=" gup();" value="Save" />
  </apex:pageBlockButtons>
  <apex:pageBlockSection >
   <apex:pageBlockSectionItem >
    <apex:outputLabel value="Checklist Template" />
    <apex:inputField value="{!Checklist__c.Checklist_Template__c}" required="true" /> 
   </apex:pageBlockSectionItem>
     </apex:pageBlockSection> 
    </apex:pageBlock>
  
<!-- Here are the 6 fields that are generated by the lookup field -->
  <input type="text" id="AccountID_lkid" name="j_id0:form1:j_id2:j_id5:j_id6:AccountID_lkid"  />
  <input type="text" id="AccountID_lkold" name="j_id0:form1:j_id2:j_id5:j_id6:AccountID_lkold"  />
  <input type="text"  name="j_id0:form1:j_id2:j_id5:j_id6:AccountID_lspf" value="0"  />
  <input type="text"  name="j_id0:form1:j_id2:j_id5:j_id6:AccountID_mod" value="0"  />
  <input type="text"  name="j_id0:form1:j_id2:j_id5:j_id6:AccountID_lktp" value="001"  />
  <input type="text" id="AccountID" name="j_id0:form1:j_id2:j_id5:j_id6:AccountID"  />
  
<!-- Here is the code to pull the Account ID and Name out of the url. This definitely works -->
<script type="text/javascript">

   var regexS = "[\\—&]CF00NS0000000M2Je_lkid=([^&#]*)";
   var regex = new RegExp( regexS );
   var results = regex.exec( window.location.href );
   document.getElementById('AccountID_lkid').value = results[1];
 
 var regexS2 = "[\\–&]CF00NS0000000M2Je=([^&#]*)";
   var regex2 = new RegExp( regexS2 );
   var results2 = regex2.exec( window.location.href );
   document.getElementById('AccountID').value = results2[1];
   document.getElementById('AccountID_lkold').value = results2[1];
  </script>
  </apex:form>
</apex:page>

 
Now I realize I can override the Standard controller and just grab the ID out of the request and it would work just fine, but I really want to understand why this does not work with just the standard controller. This is a pretty big loss of functionality when the page used to pre-populate with the Account ID and then when you write a Visualforce page it no longer does.

Thanks,
Sara
  • October 13, 2008
  • Like
  • 0