• sggottlieb
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies

I am stuck with this query that is supposed to pull a count of related objects with every object.

 

My data model is that I have an "Assignment" object that has a lookup field that points to a "Resource" object.  The Resource object doesn't have any fields pointing to Assignments.  

 

From the documentation, it seems like my query should look like this:

 

resources = [ SELECT Name,
              Primary_Discipline__c,
              Project_Manager__c,
              Account_Executive__c,
              Foreign_Languages__c,
              (SELECT count() FROM SFDC_Assignment__r)
             FROM SFDC_Resource__c
          ];

 

The error message I get is:

 

Error: Compile Error: Didn't understand relationship 'SFDC_Assignment__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. at line 6 column 23

 

Any ideas?

 

Thanks,

 

Seth

I am setting up a demo for a client that is in the consulting business.  I am using the Services Project Manager application from Application Exchange as a starting point.  One of my requirements is that any "Contact" can be staffed as a resource on a project.  I am thinking the best way to implement this is to create a bi-directional link between "Resource" and "Contact."  I modified Resource to reference Contact but I want to be able to see that relationship from within the Contact record too.  

 

More importantly, is this the best way to implement this requirement.  Would it make more sense to use a "Master-Detail" relationship and write some trigger to create an empty Resource whenever a contact is created?  Or should I just start hacking the Services Project Manger to use Contacts as Resources rather than Resource Objects?

 

Any guidence would be greatly appreciated.

 

Thanks,

 

Seth

I am stuck with this query that is supposed to pull a count of related objects with every object.

 

My data model is that I have an "Assignment" object that has a lookup field that points to a "Resource" object.  The Resource object doesn't have any fields pointing to Assignments.  

 

From the documentation, it seems like my query should look like this:

 

resources = [ SELECT Name,
              Primary_Discipline__c,
              Project_Manager__c,
              Account_Executive__c,
              Foreign_Languages__c,
              (SELECT count() FROM SFDC_Assignment__r)
             FROM SFDC_Resource__c
          ];

 

The error message I get is:

 

Error: Compile Error: Didn't understand relationship 'SFDC_Assignment__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. at line 6 column 23

 

Any ideas?

 

Thanks,

 

Seth

I am setting up a demo for a client that is in the consulting business.  I am using the Services Project Manager application from Application Exchange as a starting point.  One of my requirements is that any "Contact" can be staffed as a resource on a project.  I am thinking the best way to implement this is to create a bi-directional link between "Resource" and "Contact."  I modified Resource to reference Contact but I want to be able to see that relationship from within the Contact record too.  

 

More importantly, is this the best way to implement this requirement.  Would it make more sense to use a "Master-Detail" relationship and write some trigger to create an empty Resource whenever a contact is created?  Or should I just start hacking the Services Project Manger to use Contacts as Resources rather than Resource Objects?

 

Any guidence would be greatly appreciated.

 

Thanks,

 

Seth