• Chris Collier 6
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
I'm trying to query across three objects:
  • Account
  • Contact
  • Transaction (custom)
Some notes:
  • The relationship from Transaction to Account is AcountId__r
  • The relationship from Account to Contact is Contacts (correct me if I'm wrong)
  • Name is a field on Transaction
As a start, I'm trying to get:
  • Names of all Transactions
  • Names of the associated Accounts
  • Ids of the Contacts associated with those Accounts

Trying the following:
SELECT Name, AccountId__r.Name, AccountId__r.Contacts.Id FROM Transaction__c

I get:
ERROR at Row:1:Column:33 Didn't understand relationship 'Contacts' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Trying this:
SELECT Name, AccountId__r.Name, (Select AccountId__r.Contacts.Id FROM AccountId__r) FROM Transaction__c

I get:
ERROR at Row:3:Column:6
Didn't understand relationship 'AccountId__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

What is the correct way to write this query?
We are about to invest a lot more time into email marketing (via Active Campaign) and they want us to leverage more tags to do segmentation in the automated journeys. My end users have also asked for tags so we can group clients geographically and other ways.

I looked into this a bit and it appears that a) Tags don't work in Lightning and b) Salesforce is pushing Topics to be used instead of tags. However, I can't find that you can report on Topics (e.g. find all Contacts with tag x or without tag y).

The way around this is to create a custom picklist field, which can be reported on. I don't love this solution because the picker can get a little unwieldy when you have a lot of tags. It also doesn't allow users to create new tags on the fly. I really like the Topics component interface - it's super clean and easy to see at a glance - but really don't like that you can't report on it.

Before I implement this, does anyone know if I'm missing anything? Is there one way or another that other people are going? TIA.
Hi all,

I recently found that we are hitting our 20,000 daily API limit.  There are two users in particular on the API Requests Over Last 7 Days report that are using a lot (one is at about 7000 and the other at about 13000 - every other user uses less than 100 per day).

I have no idea what could be doing this.  The only app that either of them.  The user with 13000 daily calls literally only has one OAuth Connected App (ZynSync for Salesforce).  All users have the same app installed and nobody else is having this problem.  I reached out to the creator, ZynBit, and they aren't seeing anything odd on their end except that when it hits 20,000, they can no longer make API calls.

Does anyone have any ideas of where else to look?
When deploying from sandbox to prod, my custom fields in my change set are coming through hidden.  Even if I make the fields accessible to all profiles in sandbox, even an admin cannot see them by default in prod.  I then have to go and change the settings in prod for each individual field for them to show.  I have not been exporting the profile settings from sandbox.  Is it best practice to do so when you deploy?

Thanks
Hi I'm getting back into SF development and was setting up the Force.com IDE today.  When pulling my project from my sandbox, I gave it about 10 minutes and nothing - frozen completely.  I tried The Welkin Suite and was able to get the project to download, but it took forever.  Now I'm trying to pull down individual classes and triggers and am getting similar delays (two minutes for a class that is < 30 lines of code deep - currently on a 5 minute wait for a 200-line trigger).  I'm on na30 - is this wait time normal?

I've tried disabling Windows firewall and my connection is 100+Mbps both up and down.
I refershed a sandbox yesterday at around 8 (~26 hours ago) and am still waiting.  We're a small org (< 2 GB of total storage).  Is everyone else seeing similar wait times?
General beginner question:  We're using Campaign Monitor for mass/transactional emails and want to hook up with the API for transactional emails.  It's easy enough to hook up to their system using process builder or an Apex trigger.  However, these transactional emails go out to the client and it's important that we get a chance to review them first, so I don't want them to send on Insert/Update.  Ideally, I'd like the user to be able to click one button and have a draft sent to them and another button sends to the clients.  This isn't difficult in Apex, I just can't figure out where to call it from.  It's my understanding that buttons can't trigger Apex.  Where would be the best place to call it from?  I thought of hitting their API using an onclick Javascript button but that violates same origin policy and I Campaign Monitor doesn't appear to support JSONP.
Hi everyone, I'm teaching myself Apex so please bear with me.  This is part 1 of a two-part trigger I'm trying to find (this is the easy part or so I thought).

I have a custom object, Listing__c, with a Date field, Active_Date__c.  The first part of the trigger is supposed to restrict the field Active_Date__c from being cleared.  Here is my code:
 
trigger ListingActiveDateUpdate on Listing__c (before update) {
    
    //Pull all listings being acted on and their associated tasks
    List<Listing__c> listingsWithTasks = [SELECT Id, Active_Date__c,(Select Subject, ActivityDate
                                                                    FROM Tasks)
                                          FROM Listing__c WHERE Id IN :Trigger.new];
    
    
    //Loop over all records being acted on
    for (Listing__c listing : listingsWithTasks){
        //RESTRICT DELETING ACTIVE DATE
        //If old Active Date was not null and new Active Date is null
        if (listing.Active_Date__c == null && Trigger.oldMap.get(listing.Id).Active_Date__c != null){
            //Add error to new listing record
            listing.addError('Cannot remove an active date from a listing');
        }
        
        
      
}
Ignore the fact that I'm querying tasks for now (that's for part 2).  I am trying to grab the old value for Active_Date__c, grab the new value for Active_Date__c, and compare the two.  I've tested this and it's not working.  I even threw in some dummy code to output these values:
        System.debug(listing.Active_Date__c); <- I would think it would show the new value of Active_Date__c because the SOQL query was written from Trigger.new?
        System.debug(Trigger.oldMap.get(listing.Id).Active_Date__c);
And the result showed that these two values were the same, even though I was going through the UI and deleting one.   Can someone please take a look and let me know where I went wrong?

Your help is much appreciated.

Chris
We are about to invest a lot more time into email marketing (via Active Campaign) and they want us to leverage more tags to do segmentation in the automated journeys. My end users have also asked for tags so we can group clients geographically and other ways.

I looked into this a bit and it appears that a) Tags don't work in Lightning and b) Salesforce is pushing Topics to be used instead of tags. However, I can't find that you can report on Topics (e.g. find all Contacts with tag x or without tag y).

The way around this is to create a custom picklist field, which can be reported on. I don't love this solution because the picker can get a little unwieldy when you have a lot of tags. It also doesn't allow users to create new tags on the fly. I really like the Topics component interface - it's super clean and easy to see at a glance - but really don't like that you can't report on it.

Before I implement this, does anyone know if I'm missing anything? Is there one way or another that other people are going? TIA.
Hi I'm getting back into SF development and was setting up the Force.com IDE today.  When pulling my project from my sandbox, I gave it about 10 minutes and nothing - frozen completely.  I tried The Welkin Suite and was able to get the project to download, but it took forever.  Now I'm trying to pull down individual classes and triggers and am getting similar delays (two minutes for a class that is < 30 lines of code deep - currently on a 5 minute wait for a 200-line trigger).  I'm on na30 - is this wait time normal?

I've tried disabling Windows firewall and my connection is 100+Mbps both up and down.
I refershed a sandbox yesterday at around 8 (~26 hours ago) and am still waiting.  We're a small org (< 2 GB of total storage).  Is everyone else seeing similar wait times?
Hi everyone, I'm teaching myself Apex so please bear with me.  This is part 1 of a two-part trigger I'm trying to find (this is the easy part or so I thought).

I have a custom object, Listing__c, with a Date field, Active_Date__c.  The first part of the trigger is supposed to restrict the field Active_Date__c from being cleared.  Here is my code:
 
trigger ListingActiveDateUpdate on Listing__c (before update) {
    
    //Pull all listings being acted on and their associated tasks
    List<Listing__c> listingsWithTasks = [SELECT Id, Active_Date__c,(Select Subject, ActivityDate
                                                                    FROM Tasks)
                                          FROM Listing__c WHERE Id IN :Trigger.new];
    
    
    //Loop over all records being acted on
    for (Listing__c listing : listingsWithTasks){
        //RESTRICT DELETING ACTIVE DATE
        //If old Active Date was not null and new Active Date is null
        if (listing.Active_Date__c == null && Trigger.oldMap.get(listing.Id).Active_Date__c != null){
            //Add error to new listing record
            listing.addError('Cannot remove an active date from a listing');
        }
        
        
      
}
Ignore the fact that I'm querying tasks for now (that's for part 2).  I am trying to grab the old value for Active_Date__c, grab the new value for Active_Date__c, and compare the two.  I've tested this and it's not working.  I even threw in some dummy code to output these values:
        System.debug(listing.Active_Date__c); <- I would think it would show the new value of Active_Date__c because the SOQL query was written from Trigger.new?
        System.debug(Trigger.oldMap.get(listing.Id).Active_Date__c);
And the result showed that these two values were the same, even though I was going through the UI and deleting one.   Can someone please take a look and let me know where I went wrong?

Your help is much appreciated.

Chris

Can anyone suggest, how ca we delete apex class from production.

please provide step-step process to delete it from prod. through Force.com Eclipse.

  • October 29, 2010
  • Like
  • 1