• Prince_sfdc
  • NEWBIE
  • 80 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 20
    Replies
I am trying to build a query to help with buyer-journey reporting. I am trying to do this with only SOQL, not Apex. I think I might be querying the wrong object but I'm not sure how to build this query to give me everything I need.

Here is my query: 

SELECT Id,FirstRespondedDate,Campaign.Name,Status,Date_Responded__c,CreatedDate,ContactId FROM CampaignMember WHERE CampaignId IN (SELECT CampaignId FROM Opportunity WHERE StageName = 'Closed–Won' AND CloseDate = THIS_YEAR) AND ContactId IN (SELECT ContactId FROM OpportunityContactRole)

This works and gives me almost everything I need, but I need to return CloseDate in addition to these other fields. Is this possible? Do I need to flip this and query the Contact object instead, using nested queries to grab both campaign member and opportunity fields?
what is the difference between the getValue() and getLabel() in PickListEntry Class, please explain with an example for each.
Initial term of field expression 
​must be a concrete SObject: List<Contact> at line 12 column 6.
 
trigger CreateContact on Account (After Insert)
{
 
 //Collection of contacts for saving new contacts.
 List<Contact> conList =new List<Contact>();
 
 for(Account acc: trigger.new)
 {
     // For each Account create a new Contact.
     List<Contact> freshCon=new List<Contact>();
     
     freshcon.Accountid=acc.id;
     freshcon.LastName=acc.Name +'_'+ acc.CustomerPriority__c;
     
     //add new Contact to the collection.
     conList.add(freshcon);
     
 }
 
insert conList;
 

}
An error is getting encountered "Collection size 1,738 exceeds maximum size of 1,000" , when I click on a installed package's app. 

I've a app exchange product installed in my or i.e. Easy Describe, but when I go to my list of my apps and click easy describe it throws this error. 
I'm perplexed how to resolve. 
when I run the block of ‘static’ code in execute anonymous, it throws an error “only top-level methods in the class are allowed to be declared as static”. I tried my code also: there also same issue.
 public StringArrayTest {  public static void generateStringArray() {}  }
 Can anyone help on this?

thank you.
I am trying to cover a method which uses formula field.
This is my test class code:

SObject1__C coltype = new SObject1__C();
coltype.name = 'Name-3312';
insert coltype;
System.debug('--->SObject1.Name = '+coltype.name); // Gives 'Name-3312';

SObject2__C colObj = new SObject2__C();
colObj.SObject1__C = coltype.Id;
insert colObj;  

SObject3__C newCollP = new SObject3__C();
newCollP.SObject2__C = colObj.Id,
insert newCollP;

SObject3__C has a fomula field named 'Col_Type__C' which is evaluated as follows:
"SObject2__r.SObject1__r.Name"
System.debug('--->newCollP.Col_Type__C = '+ newCollP.Col_Type__C); //returns a2Hg0000001tqQ2

This 'Col_Type__C' field's value is then used in a method in a helper class which i am trying to cover. As posted by many, I have tried to query the object SObject3__C and populate the field Col_Type__C in the test class as below. But it's not populatting the formula field's value as 'Name-3312'. 
newCollP = [SELECT Id,SObject2__r.SObject1__r.Name, Col_Type__C from SObject3__C where Id=:newCollP.id];

When I debug Col_Type__C value in helper class it returns some ID. I need the value of  as name of SObject1__C.

What is missing in my code? How can I get the formula field populated? 

Any help is appreciated!
I am trying to build a query to help with buyer-journey reporting. I am trying to do this with only SOQL, not Apex. I think I might be querying the wrong object but I'm not sure how to build this query to give me everything I need.

Here is my query: 

SELECT Id,FirstRespondedDate,Campaign.Name,Status,Date_Responded__c,CreatedDate,ContactId FROM CampaignMember WHERE CampaignId IN (SELECT CampaignId FROM Opportunity WHERE StageName = 'Closed–Won' AND CloseDate = THIS_YEAR) AND ContactId IN (SELECT ContactId FROM OpportunityContactRole)

This works and gives me almost everything I need, but I need to return CloseDate in addition to these other fields. Is this possible? Do I need to flip this and query the Contact object instead, using nested queries to grab both campaign member and opportunity fields?
Hi,

While going through the code of one of the class in my project I found that PriceBookEntry object is used. However when I tried to find it in setup/object menu I couldn't find. But I can find this object in eclipse as PricebookEntry.object.

Can anyone please let me know how I can find it in setup.

Arun.
what is the difference between the getValue() and getLabel() in PickListEntry Class, please explain with an example for each.
Hi,

Problem with "Creating Global Quick Actions" Module

There was an unhandled exception. Please reference ID: TGHDVSER. Error: Faraday::Error::ResourceNotFound. Message: NOT_FOUND: The requested resource does not exist

I've tried this several times now, over two days.  Deleted and recreated, but still get the same error.

Would really like to complete this module.  Any help appreciated.  thanks, 
when I run the block of ‘static’ code in execute anonymous, it throws an error “only top-level methods in the class are allowed to be declared as static”. I tried my code also: there also same issue.
 public StringArrayTest {  public static void generateStringArray() {}  }
 Can anyone help on this?

thank you.
Is there something special that I have to do to have ProcessBuilder findmy email templates?

I'm trying to send an email that includes a link to a record in Saleforce using apex email alert and the setHtmlBody method.  I'm trying to send the link like so..

 

<a href="'+URL.getSalesforceBaseUrl()+'/'+workOrder.id+'">'+workOrder.Name+'</a>

 The email gets sent out just fine, but the link isn't there.  When I look at the source in the email it shows the a tag without the href attribute like so...

<a>Work Order Name</a>

 Can anybody tell me why this is happening and what I can do to get the link to work?

  • December 04, 2013
  • Like
  • 0

Hi ,

 

Could someone please point out the difference between 'save to database' and 'Commit to database'? This will be really helpful.

 

Thanks

Sam

I am trying to show and hide <div> when a drop down from a list from a custom field.

 

For example, if I have a dropdown value of

1) value 1

2) value 2

3) value 3

 

When I select value 3, it will show a hidden <div> with jQuery in visualforce page.

 

I can do this in the standard html page, using ids and classes—but I don't know how to put id's or classes' on value 3 because it is a custome field from salesforce...

Hi,

 

In lookups for standard object, we have New button on lookup dialig.

Is it possible to have New button on lookup dialog for Cutom Object. If yes please let me know the steps or workaround

 

Thanks

trigger FindMarketTerritoryFromMarket on Territory_Market__c (before insert, before update) { Map<Id,Territory_Market__c> territoryMarket= new Map<Id,Territory_Market__c>(); for(Territory_Market__c t : Trigger.new) { if(t.Parent_Market__c!=Trigger.oldMap.get(t.Id).Parent_Market__c){ territoryMarket.put(t.Id,t); System.debug(t.Parent_Market__c); } } List<Account> updateAccount = new List<Account>(); Map<Id,String> setAccount= new Map<Id,String>(); for(Id ids : territoryMarket.KeySet()){ List<Account> account = new List<Account>(); account = [Select a.Name From Account a limit 1]; } }

 

this is my code. I removed update account code from this.

 

This is simple code not doing anything yet,still it fails at account = [Select a.Name From Account a limit 1]; line.

 

It giveme error :

 

Review all error messages below to correct your data.
Apex trigger FindMarketTerritoryFromMarket caused an unexpected exception, contact your administrator: FindMarketTerritoryFromMarket: execution of BeforeUpdate caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Trigger.FindMarketTerritoryFromMarket: line 31, column 8

 

I tried to pass only not null value still same problem. Then I rmoved all where condition and trying very simple query,still didn't help.

 

Can someone let me know workaroud for this problem?

 

Thanks