• Peter Gruhl
  • NEWBIE
  • 9 Points
  • Member since 2010
  • Senior Technical Trainer


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 9
    Replies
**Still Learning**
I am trying to create the Apex Controller that will then be used by the Visualforce page for layouts.  I only want to show the Current Fiscal Period based on Todays date on the Visualforce page.  

Period_FY__c is just a formula field that is a String:  Below is the code for the formula field.
CASE( 
Text(Month(TODAY() )) , 
"1","2", 
"2","3", 
"3","3", 
"4","3", 
"5","4", 
"6","4", 
"7","4", 
"8","1", 
"9","1", 
"10","1", 
"11","2", 
"12","2", 
"" 
)

The code where I am having an error.  If there is a different way this would be written better I am open. (learning)

public with sharing class QuotaRelatedListqtr {

public List <Quota__c> quotas {get;set;}
public List <Business_Plan__c> bp {get;set;}
public List <Period> period {get;set;}
    
Integer FiscalYearStartMonth = 
[select FiscalYearStartMonth from Organization where id=:Userinfo.getOrganizationId()].FiscalYearStartMonth;

String TodaysDate = date.today().format();
     
Public List <Period> Periods = [Select p.Number From Period p 
         Where (p.StartDate <= TODAY AND p.EndDate >= TODAY) and p.type = 'Quarter' Limit 1];


       // Get information about the Quota being worked on
       // Needs to be based on Business Plan per Person 
       // Need to get the correct FY and Correct Quarter based on todays date.    
       // 
public QuotaRelatedListqtr(ApexPages.StandardController controller) {
 quotas = [SELECT Actual_Sales__c, Actual_vs_Quota__c, Annual_Actual_Sales__c, Annual_Quota__c, 
                           Annual_Targeted_New_Business_Sales__c, Business_Plan__c, Fiscal_Period2__c,
                               Quota__c, Sales_Categories__c, Sales_Category_Name__c,  Sales_Needed_to_Hit_Quota__c,Sales_Product_Category__c,
                               Sales_Won__c, Targeted_New_Business__c,Target_vs_Quota__c,Targeted_New_Business_Sales__c
                               FROM Quota__c
                              WHERE Period_FY__c IN :Periods];    
                             
    }
              
}


Here is the Error Message:  Invalid bind expression type of Period for column of type String
I have bolded the line where it is saying the error is.

 
Hello,

  I am little bit confuse.
  which one execute first validation rule or before trigger.

Hi,
 
I want to integrate a web applciation with salesforce. My prefered way it through REST API to do a post call.


Here is the scenario I am trying to achive:


I have an Id, I want to query a companies salesforce database and look for an existing record that matches the given Id. If it is found, I would like to update this existing record. If there was no match, I would like to create a new record in their database based on that Id.
 
How can I achive this? Where can I get token/auth for API calls? How can I make these API calls? What are the steps I have to take?
 
I have already signed up for developers edition.

I am not looking for C#/JAVA/... codes. I just want to do a simple Post call while passing that Id.
 
I would greatly appriciate any help you can give me on this matter.

  • September 27, 2016
  • Like
  • 0

Hi,
I have created some charts and dashboards in Wave: Salesforce Analytics Cloud and I want to embed those charts in a visual force page. So is there any way to do this?

Hi ,

I am inserting records into the opportunityShare object programtically thru a trigger, while inserting the record I am setting the userOrGroupID field in the oppotunityShare to a public group.  When I change the owner of the opportunity, all these sharing records get deleted. While if I change any other field on the opportunity, the records in the opportunityShare object are intact.

 

Could anyone please let me know as to why this behaviour is happening?? And how can we avoid this?

 

Regards

Sam

I'm getting the attached error when attempting to install the latest Force.com IDE plugin on the latest Eclipse version with the latest JDK installed.  The error comes up after I click next on the "Available Software" selection screen of the "Install New Software" dialog.  How can I fix this problem?  Thank you!

 

 

Cannot complete the install because of a conflicting dependency.
  Software being installed: Force.com IDE 20.0.1.201011121559 (com.salesforce.ide.feature.feature.group 20.0.1.201011121559)
  Software currently installed: Shared profile 1.0.0.1284708747720 (SharedProfile_epp.package.java 1.0.0.1284708747720)
  Only one of the following can be installed at once: 
    Structured Source Editor 1.2.2.v201008232126 (org.eclipse.wst.sse.ui 1.2.2.v201008232126)
    Structured Source Editor 1.1.102.v200910200227 (org.eclipse.wst.sse.ui 1.1.102.v200910200227)
  Cannot satisfy dependency:
    From: Shared profile 1.0.0.1284708747720 (SharedProfile_epp.package.java 1.0.0.1284708747720)
    To: org.eclipse.wst.sse.ui [1.2.2.v201008232126]
  Cannot satisfy dependency:
    From: Force.com IDE 20.0.1.201011121559 (com.salesforce.ide.feature.feature.group 20.0.1.201011121559)
    To: org.eclipse.wst.html.ui [1.0.0,2.0.0)
  Cannot satisfy dependency:
    From: HTML UI Source Editor 1.0.401.v200908111935 (org.eclipse.wst.html.ui 1.0.401.v200908111935)
    To: bundle org.eclipse.wst.sse.ui [1.1.0,1.2.0)

 

 

  • February 03, 2011
  • Like
  • 0

I have posted, discussed, and now I am desperately seeking a solution to my issue (I can't be the only one, either!). Here's my delema (and I am not technically oriented either, so please be patient):

We currently have 10 different company divisions, yet we house ALL contacts under one SalesForce (enterprise). Because there is some crossover, some of our contacts get multiple email messages from us. Each email blast needs to have its own distinct Opt-Out. We currently have Opt-Out buttons set up under "Subscription Information" (contact level), but every email blast service says SalesForce only allows for a Global Opt-Out. Is there a Validation Rule that would allow each seperate Campaign an Opt-Out link that would then trigger the appropriate Opt-Out "check box" to be enabled? We are manually doing this process now, then running a report to refresh the specific Opt-Outs, then adding them to a specific Opt-Out campaign. We then set criteria to only send a message to the specific Campaign members that are not in that specific Opt-Out campaign. (Are you lost yet?) The hitch then, becomes developing a validation rule that would allow the specific Campaign's Unsubscribe link to activate the specific Opt-Out check box. Can this be done? If so, can someone help me understand how that validation rule should work?

 

SF tech support response was as follows:

I believe  that you are referring to workflow rules. Workflow can be used to set a field value based upon a trigger criteria. However, the update only takes effect when the record is created or updated so would have to touch every record which is what you are running into now. Plus, the workflow rules would be very complex if it was possible to handle the situation you have.

 

Can anyone help me? Feel free to call and discuss (646) 442-3701 and ask for Sheri.

 

**Still Learning**
I am trying to create the Apex Controller that will then be used by the Visualforce page for layouts.  I only want to show the Current Fiscal Period based on Todays date on the Visualforce page.  

Period_FY__c is just a formula field that is a String:  Below is the code for the formula field.
CASE( 
Text(Month(TODAY() )) , 
"1","2", 
"2","3", 
"3","3", 
"4","3", 
"5","4", 
"6","4", 
"7","4", 
"8","1", 
"9","1", 
"10","1", 
"11","2", 
"12","2", 
"" 
)

The code where I am having an error.  If there is a different way this would be written better I am open. (learning)

public with sharing class QuotaRelatedListqtr {

public List <Quota__c> quotas {get;set;}
public List <Business_Plan__c> bp {get;set;}
public List <Period> period {get;set;}
    
Integer FiscalYearStartMonth = 
[select FiscalYearStartMonth from Organization where id=:Userinfo.getOrganizationId()].FiscalYearStartMonth;

String TodaysDate = date.today().format();
     
Public List <Period> Periods = [Select p.Number From Period p 
         Where (p.StartDate <= TODAY AND p.EndDate >= TODAY) and p.type = 'Quarter' Limit 1];


       // Get information about the Quota being worked on
       // Needs to be based on Business Plan per Person 
       // Need to get the correct FY and Correct Quarter based on todays date.    
       // 
public QuotaRelatedListqtr(ApexPages.StandardController controller) {
 quotas = [SELECT Actual_Sales__c, Actual_vs_Quota__c, Annual_Actual_Sales__c, Annual_Quota__c, 
                           Annual_Targeted_New_Business_Sales__c, Business_Plan__c, Fiscal_Period2__c,
                               Quota__c, Sales_Categories__c, Sales_Category_Name__c,  Sales_Needed_to_Hit_Quota__c,Sales_Product_Category__c,
                               Sales_Won__c, Targeted_New_Business__c,Target_vs_Quota__c,Targeted_New_Business_Sales__c
                               FROM Quota__c
                              WHERE Period_FY__c IN :Periods];    
                             
    }
              
}


Here is the Error Message:  Invalid bind expression type of Period for column of type String
I have bolded the line where it is saying the error is.