• Brian Oconnell 23
  • NEWBIE
  • 145 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 8
    Questions
  • 10
    Replies
Hi,

I am trying to build a formula field (number) to track to number of opportunities of a certain type that contain a certain product. I have a field called "Type of Sale" (picklist) that we use to track the type of sales we make (Serialization, Serialization and aggregation, Inspection, etc). I want to create a field that will look at that field and if it has a certain value (Serialization OR Serialization and aggregation) AND a certain product (BottleTracker OR CartonTracker OR Flying CartonTracker OR Manual Print Station OR PackStation CAP OR PacStation SAP OR PackStation SAP OR LabelTracker OR BunderTracker) is attached to the opportunity, the field value will be 1. If not, it will be 0. I will then use that field to report of the % of Serialization AND Serialization and aggregation sales that include the aforementioned products.

I have came up with the following formula:

IF(AND(OR(Type_of_Sale__c="Serialization", Type_of_Sale__C="Serialization and aggreation"), (OR(PricebookEntry.Product2.Name="BottleTracker", PricebookEntry.Product2.Name="CartonTracker", PricebookEntry.Product2.Name="Manual Print Station", PricebookEntry.Product2.Name="PackStation CAP", PricebookEntry.Product2.Name="PackStation FMP", PricebookEntry.Product2.Name="PackStation SAP", PricebookEntry.Product2.Name="BundleTracker", PricebookEntry.Product2.Name="LabelTracker")), 1, 0))

When I use the "check syntax" button, the syntax is fine, but it tells me that "Picklist fields are only supported in certain functions".

How should I proceed to achieve my goal? I have absolutely no experience with advanced formulas so please dumb it down to my level.
Just installed Eclipse and Force.com IDE, but not able to create a new Force.com project because I cannot login.
I followed instructions here https://developer.salesforce.com/page/Force.com_IDE but it does not mention custom domains, so I chose "Other" for environment then entered my login url, but that did not work.

User-added image
I am the administrator and I have no idea what these Error ID's refer to.  Why does the error message tell users to contact me?  And where can I find out what the error numbers mean? 
I'm quite familiar with this error message and I know it has nothing to do with the body tags, which are correct.  Can someone please help me troubleshoot this simple VF email template with related list? Do I need something else surrounding the apex repeat tags?
Thank you
 
<messaging:emailTemplate subject="Hey" recipientType="Contact" relatedToType="Bsvp_Order__c">
<messaging:htmlEmailBody>
    <html>
        <body>
        Account Name: {!relatedTo.Account__c}</br>
        Order Name: {!relatedTo.Name}<br/>
        <apex:repeat var="ix" value="{!relatedTo.Bsvp_OLIs__r}">
            LI Name: {!ix.Name}<br/>
        </apex:repeat>
        </body>
    </html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 
I would like to use an existing Email Alert in an Apex class.
I do not want to simply send an email from the class.

The reason is that Administrators will want to change recipients and/or templates, and they should be able to do so using clicks, not code.

Is this possible?
I'm trying to make a Visualforce Email Template that uses fields from Opportunity, Opportunity Line Item (Product), and Person Account.  How can I use the Email, First Name, and Last Name fields on Person Account as recipient?

Thanks
I would love to discuss with other orgs that are using Salesforce to run ecommerce websites, or sync to them.
Hello,

I am trying to make a gauge chart in a VF component.  There is one custom object that I want to summarize by record owner, so that logged in users should only see their own result.  I have hobbled together several samples I have found in documentation, but I am stuck on the concept of AggregateResult being an object.  I can't seem to retrieve the single decimal number that I need for each user.

Controller so far:
public class GaugeController {
    public String userId {get;set;}
    public String userName {get;set;}

    public GaugeController(ApexPages.StandardController controller){
        userId = UserInfo.getUserId();
        userName = UserInfo.getName();
    }

    public List<gaugeData> getData() {
          Integer thisYear = date.Today().year();

          AggregateResult groupedResults = [select SUM(Total_Hours_Out__c)sumhrs from Absence__c where Owner.Id =: userId and CALENDAR_YEAR(Start_Date__c) =: thisYear];
          Decimal TotalHours = (decimal)groupedResults.get('sumhrs');
          //for (AggregateResult ar : groupedResults) {
          //    TotalHours += ar.get('sumhrs');
          //    }
          
          List<gaugeData> data = new List<gaugeData>();
          data.add(new gaugeData(userName, TotalHours));
          return data;
          }
    public class gaugeData {
        public String name {get;set;}
        public Decimal hours {get;set;}
        
        public gaugeData(String name, Decimal data) {
            this.name = name;
            this.hours = data;
        }
    }
}
And VF page so far:
<apex:page standardController="User" sidebar="false" showHeader="false" extensions="GaugeController">
    <apex:chart name="TimeOff" height="300" width="300" animate="true" data="{!data}">
        <apex:axis type="Gauge" position="gauge" title="Time Off Hours Remaining This Year" minimum="0" maximum="100" steps="8"/>
        <apex:gaugeSeries dataField="hours" donut="50" colorSet="#0099ff,#ff0066"/>
    </apex:chart>
    
</apex:page>
I'm not a regular coder, so I would appreciate any help.

Thanks!
I have a simple Visual Flow embedded in a simple Visualforce page that creates a record in a custom object.  When the flow ends, I would like to redirect to the detail page of the record that was just created (using a Flow variable).  How can I reference a flow variable in the <flow>'s returnurl parameter?
User-added image
Please suggest best way to accomplish below mentioned task
1. We want that when new Lead is created then its LeadOwner is assigned with the help of RoundRobin logic.
2. If LeadOwner is updated through salesforce user interface then it should be changed.
3. But when Lead is updated through data import then its LeadOwner should not change. Even if there is LeadOwnerId in imported CSV
I would like to use an existing Email Alert in an Apex class.
I do not want to simply send an email from the class.

The reason is that Administrators will want to change recipients and/or templates, and they should be able to do so using clicks, not code.

Is this possible?
Hi,

I am trying to build a formula field (number) to track to number of opportunities of a certain type that contain a certain product. I have a field called "Type of Sale" (picklist) that we use to track the type of sales we make (Serialization, Serialization and aggregation, Inspection, etc). I want to create a field that will look at that field and if it has a certain value (Serialization OR Serialization and aggregation) AND a certain product (BottleTracker OR CartonTracker OR Flying CartonTracker OR Manual Print Station OR PackStation CAP OR PacStation SAP OR PackStation SAP OR LabelTracker OR BunderTracker) is attached to the opportunity, the field value will be 1. If not, it will be 0. I will then use that field to report of the % of Serialization AND Serialization and aggregation sales that include the aforementioned products.

I have came up with the following formula:

IF(AND(OR(Type_of_Sale__c="Serialization", Type_of_Sale__C="Serialization and aggreation"), (OR(PricebookEntry.Product2.Name="BottleTracker", PricebookEntry.Product2.Name="CartonTracker", PricebookEntry.Product2.Name="Manual Print Station", PricebookEntry.Product2.Name="PackStation CAP", PricebookEntry.Product2.Name="PackStation FMP", PricebookEntry.Product2.Name="PackStation SAP", PricebookEntry.Product2.Name="BundleTracker", PricebookEntry.Product2.Name="LabelTracker")), 1, 0))

When I use the "check syntax" button, the syntax is fine, but it tells me that "Picklist fields are only supported in certain functions".

How should I proceed to achieve my goal? I have absolutely no experience with advanced formulas so please dumb it down to my level.
Hello,

I am trying to make a gauge chart in a VF component.  There is one custom object that I want to summarize by record owner, so that logged in users should only see their own result.  I have hobbled together several samples I have found in documentation, but I am stuck on the concept of AggregateResult being an object.  I can't seem to retrieve the single decimal number that I need for each user.

Controller so far:
public class GaugeController {
    public String userId {get;set;}
    public String userName {get;set;}

    public GaugeController(ApexPages.StandardController controller){
        userId = UserInfo.getUserId();
        userName = UserInfo.getName();
    }

    public List<gaugeData> getData() {
          Integer thisYear = date.Today().year();

          AggregateResult groupedResults = [select SUM(Total_Hours_Out__c)sumhrs from Absence__c where Owner.Id =: userId and CALENDAR_YEAR(Start_Date__c) =: thisYear];
          Decimal TotalHours = (decimal)groupedResults.get('sumhrs');
          //for (AggregateResult ar : groupedResults) {
          //    TotalHours += ar.get('sumhrs');
          //    }
          
          List<gaugeData> data = new List<gaugeData>();
          data.add(new gaugeData(userName, TotalHours));
          return data;
          }
    public class gaugeData {
        public String name {get;set;}
        public Decimal hours {get;set;}
        
        public gaugeData(String name, Decimal data) {
            this.name = name;
            this.hours = data;
        }
    }
}
And VF page so far:
<apex:page standardController="User" sidebar="false" showHeader="false" extensions="GaugeController">
    <apex:chart name="TimeOff" height="300" width="300" animate="true" data="{!data}">
        <apex:axis type="Gauge" position="gauge" title="Time Off Hours Remaining This Year" minimum="0" maximum="100" steps="8"/>
        <apex:gaugeSeries dataField="hours" donut="50" colorSet="#0099ff,#ff0066"/>
    </apex:chart>
    
</apex:page>
I'm not a regular coder, so I would appreciate any help.

Thanks!
I have a simple Visual Flow embedded in a simple Visualforce page that creates a record in a custom object.  When the flow ends, I would like to redirect to the detail page of the record that was just created (using a Flow variable).  How can I reference a flow variable in the <flow>'s returnurl parameter?
User-added image
Is there a way to call an existing Email alert and pass it a record value for the merge fields? The object generating the email alert is a custom object called Account_Counselor__c. This alert is sent to myself and another admin when a APEX CLASS attempts to add a UserPackageLicense but there are no licenses available from PackageLicense. This alert will let us know that we need to buy more licenses. I already have the email alert setup and it works fine from a Visual Flow but I can't figure out how to call it from APEX as well. 
 
I wanted to figure out if there is or if there is any plan to open challenges data via an api so that we can reward employees for completing trialhead data.

I'm hope to create a web from where clients can enter information...this info is then sent back to our org and populated w/in custom objects. Needs to be secured....Would Site.com or Force.com Sites do that? Very simaler to Web to Lead (BUT SECURED). I would Just Like to start off on the right foot! 

 

  • September 11, 2013
  • Like
  • 0
I have a text formula to which I would like to add a carriage return/line break.  I tried concatenating chr(13) and chr(10), but the validation didn't like it.  Is this possible?
I wanted to figure out if there is or if there is any plan to open challenges data via an api so that we can reward employees for completing trialhead data.
So I have created flows before where the flow is started from a record using a custom button, and that record's ID is passed into the flow as a variable, which is great!

However, I now want to do this but starting from a list view, where I would select (check) a bunch of records and then click a custom button to start the flow, and have the record IDs of all the checked records pass into the flow as a list of variables (I think it would be an sObject variable?)

Is this possible? 
Thanks
  • February 20, 2015
  • Like
  • 3