• SteveOrg93
  • NEWBIE
  • 10 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
Hi there, I'm hoping someone here can help understand why we are having trouble reading data from a master detail custom object.

We have a custom object that is a master detail relationship to the contact.  Upon fetching the custom object fields (custom_object__r) along with the Saleforce contact fields, Salesforce is returning back the following error:

Didn't understand relationship 'custom_object__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.

I looked around through other threads that mentioned I might need to replace custom_object__r with the ObjectID, however that doesn't change the error message returning back.  

Is there a proper way to return custom object data upon returning contact information?

Here is the query: 
SELECT Name, Account.Name, Title, Email, AccountId, Id, (SELECT custom_field__c FROM Custom_Object__r) FROM Contact WHERE Email = 'name@http://example.com'

Hi there, I'm hoping someone here can help understand why we are having trouble reading data from a master detail custom object.

We have a custom object that is a master detail relationship to the contact.  Upon fetching the custom object fields (custom_object__r) along with the Saleforce contact fields, Salesforce is returning back the following error:

Didn't understand relationship 'custom_object__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.

I looked around through other threads that mentioned I might need to replace custom_object__r with the ObjectID, however that doesn't change the error message returning back.   

Is there a proper way to return custom object data upon returning contact information?

Hi There, I created a trigger to execute on a lead when the Lead Status value is changed.  I am able to save the code below, however the task is not being created.  I hardcoded the ownerID for the task for this test.   If anyone knows what I am missing this would be greatly appreciated!

 

trigger createLeadActivity on Lead (after update) { 

    //make a set to hold LeadIds that we need
    Set<Id> leadIds = new Set<Id>();
  
   
    for(Lead l : trigger.new)
        {
        //check to see if our field has been changed
        if(l.status != trigger.oldMap.get(l.Id).Status){
            
            leadIds.add(l.Id);
            
        }

       }
    
    if(!leadIds.isEmpty()){
        
       
        
        List<Lead> leadList = 
            [SELECT Id,Status
            FROM Lead
            WHERE Status = '4 - SAL Engaged' AND Id IN :leadIds ];
            
        
        
        
        
        for(Lead lead: trigger.new){
       
       
        
        
       
        Task newTask = new Task(Subject='LeadPassed',
Status='Not Started',Priority='Normal', OwnerId ='005E0000000QD4F');



        }
       
    }


}

 

Hi Everyone, I was hoping I could get some insights as to what might be wrong with my trigger.  I have the following trigger I would like to run when a lead status within the lead is changed to a particular value.  When the value is changed, I would like to create a new activity on the lead record.  

 

Here is my code below, and the error I get back is:

 

Error: Compile Error: No access to entity: Activity at line 1 column 1

 

Any help would be greatly appreciated!

 

 

trigger createLeadActivity on Lead (after update) { 

    //make a set to hold opportunity ids that we need
    Set<Id> leadIds = new Set<Id>();
    
    for(Lead l : trigger.new)
        {
        //check to see if our field has been changed
        if(l.status != trigger.oldMap.get(l.Id).Status){
            
            leadIds.add(l.Id);
            
        }

       }
    
    if(!leadIds.isEmpty()){
        
       
        
        List<Lead> leadList = 
            [SELECT Id,Status
            FROM Lead
            WHERE Status = '4 - SAL Engaged' AND Id IN :leadIds ];
        
        
        
        for(Lead leadly: leadList){
        Lead led = new Activity();
        
       
        
        
       
        Activity newActivity = new Activity(Subject='LeadPassed',OwnerId=leadMap.get( record.WhoId ).OwnerId,Status='Not Started',Priority='Normal',WhoId=leadMap.get( record.WhoId ).id);

        ActList.add(newActivity);
        }
       
    }


}

 

Hi there, I was hoping I would be able to get some guidance on the preferred solution to get this working in salesforce.

 

There is currenty a formula field in our opportunities that look at three fields to caculate whether an opportunity is active: 

 

AND( IsWon = True, Billing_Start_Date__c  <= TODAY(), Contract_End_Date__c  >= TODAY()).

 

The issue is that I plan on rolling up opportunities that are "active" on the account, however salesforce doesn't support filtering the opportunities for rollup using a formula field.

 

Looking at the conditions of when an opportunity is active, it seems either a workflow rule or apex trigger should be used to update the Active flag in the opportunity so that I could use it as a condition to rollup opps on the account.  However, this will need to trigger on a nighty basis and compare the opportunity date fields to today.  

 

Has anyone worked on a similar solution and would know whether the apex trigger should be appropriate for this solution?Or could I get this to work with time dependent workflow rules?  Any help is greaty appreciated.

 

Thanks!

Steve 

Hi there, I'm hoping someone here can help understand why we are having trouble reading data from a master detail custom object.

We have a custom object that is a master detail relationship to the contact.  Upon fetching the custom object fields (custom_object__r) along with the Saleforce contact fields, Salesforce is returning back the following error:

Didn't understand relationship 'custom_object__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.

I looked around through other threads that mentioned I might need to replace custom_object__r with the ObjectID, however that doesn't change the error message returning back.   

Is there a proper way to return custom object data upon returning contact information?

Hi There, I created a trigger to execute on a lead when the Lead Status value is changed.  I am able to save the code below, however the task is not being created.  I hardcoded the ownerID for the task for this test.   If anyone knows what I am missing this would be greatly appreciated!

 

trigger createLeadActivity on Lead (after update) { 

    //make a set to hold LeadIds that we need
    Set<Id> leadIds = new Set<Id>();
  
   
    for(Lead l : trigger.new)
        {
        //check to see if our field has been changed
        if(l.status != trigger.oldMap.get(l.Id).Status){
            
            leadIds.add(l.Id);
            
        }

       }
    
    if(!leadIds.isEmpty()){
        
       
        
        List<Lead> leadList = 
            [SELECT Id,Status
            FROM Lead
            WHERE Status = '4 - SAL Engaged' AND Id IN :leadIds ];
            
        
        
        
        
        for(Lead lead: trigger.new){
       
       
        
        
       
        Task newTask = new Task(Subject='LeadPassed',
Status='Not Started',Priority='Normal', OwnerId ='005E0000000QD4F');



        }
       
    }


}