• John Gallinagh 8
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
Here's a query that I'm able to get working using the Force.com Explorer, but when I try to fire it in the Developer Console it doesn't work.  What am I missing?

Force.com Explorer Query:
SELECT Id, Territory_Mapping__c, Company_HQ_Country_Full_Name__c, Territory_Mapping_State_Abbreviation__c, Company_HQ_State__c, HQ_State_Value_Territory_State__c FROM Lead
where Territory_Mapping__c !=NULL
AND(Company_HQ_Country_Full_Name__c = 'United States' OR Company_HQ_Country_Full_Name__c = 'Canada')
AND HQ_State_Value_Territory_State__c = FALSE
Developer Console
String query = 'SELECT Id, Territory_Mapping__c, Company_HQ_Country_Full_Name__c, Territory_Mapping_State_Abbreviation__c, Company_HQ_State__c, HQ_State_Value_Territory_State__c FROM Lead';
where Territory_Mapping__c !=NULL
AND(Company_HQ_Country_Full_Name__c = \'United States\' 
OR Company_HQ_Country_Full_Name__c = \'Canada\')
AND HQ_State_Value_Territory_State__c = FALSE;


 
So I have a 3rd party app running and it has some pretty cool functionality that I'm looking to re-create.  Here's what I'm trying to do.  I have quite a few validation rules on my opportunity records.  I'd like to compile and post all the fields that have not met the validation rule requirements into a single field so my users can see what fields are missing at any given point in time.  The image below shows the validation rules that haven't been satisfied yet.  How would I go about implementing something like this.

Close Won Validation Missing Fields
Recently turned on the Enterprise Territory Management functionality and I'm trying to get the Apex Class setup and keep getting an error message. I've copied the example code from the Apex Developer Guide (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_TerritoryMgmt_OpportunityTerritory2AssignmentFilter.htm#apex_interface_TerritoryMgmt_OpportunityTerritory2AssignmentFilter) and it's not working.  

I keep getting the following error:


No such column 'Territory2Id' on entity 'Opportunity'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
So I'm sure that this challenge has been solved in somewhere.  Here's what I'm looking to do.  Our phone integration with Salesforce populates the Comments field on the Task object with the information below.  I want to parse each line and take specific text from each line to populate a custom field.  Any help would be greatly appreciated.

For example:
Call status: Connected - I would like to capture the word "Connected" and populate a custom field called Call Disposition.  
Duration of the call: 00:00:38  - I would like to capture the time element (00:00:38) and populate a Call Duration field.

Call started at: 09:05 AM Wed, Aug.17 
Call ended at: 09:06 AM Wed, Aug.17 
Duration of the call: 00:00:38 
Caller: 5089587007 
Extension: 1004 
Call status: Connected 
Comments: Testing workflow to update task type field to Call
Recently turned on the Enterprise Territory Management functionality and I'm trying to get the Apex Class setup and keep getting an error message. I've copied the example code from the Apex Developer Guide (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interface_TerritoryMgmt_OpportunityTerritory2AssignmentFilter.htm#apex_interface_TerritoryMgmt_OpportunityTerritory2AssignmentFilter) and it's not working.  

I keep getting the following error:


No such column 'Territory2Id' on entity 'Opportunity'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.