Use relationships to associate an object with other objects in Salesforce.

learn more… | top users | synonyms

2
votes
1answer
62 views

Junction object confusion

I have 3 objects order, order_lines and shipment_lines . So order has many order lines and many shipment_lines. So I want to display order_lines and shipment_lines fields on a single related list on ...
2
votes
1answer
14 views

External SalesForce Forms

Is it possible to create external SalesForce Forms that can populate fields in the same way as inside salesforce? We offer online teaching and the idea is that teachers, after every lesson, can fill ...
3
votes
1answer
36 views

Mandatory to create Junction object?

I have attached a screenshot of the schema. I have order, order_lines and shipment_lines related as in the following picture... Is it mandatory to create a junction object to get shipment lines for ...
1
vote
2answers
39 views

Tally the number of items in a related lists on a related object

Hi guys I am a complete n00b with SalesForce.com, so please forgive me if my question is too basic, but I have been trying for about 2 days now and I feel like I am getting nowhere I have a database ...
3
votes
2answers
42 views

Multiple Contact 'types' on a Custom Object: Model with junction object or specific lookup relationships?

Probably a general schema design question: I have a Custom Object that will have several related Contacts. The contacts are grouped into types, for example "Agents", "Applicants", "Referees", etc; ...
2
votes
1answer
45 views

How to preserve relationships upon data import?

I've set up lookup and master-detail relationships between objects in Salesforce, and I have SQL-exported CSVs of legacy data which mirror these relationships. How do I preserve the existing ...
1
vote
2answers
41 views

Relate records from the same custom object

I have a custom object called 'Events'. I would like to create a relationship that allows Event records to be related to other Event records. Is this possible using standard customisation?
4
votes
3answers
76 views

How to use Name Object

I am using the Java API and trying to create an Attachment with a reference to the Parent external Id field. The setParent() method takes a Name object as the parameter. For what I read, the Name ...
0
votes
2answers
58 views

Access data in Visualforce/Formula fields through Custom Junction Object [duplicate]

I have three custom objects: Entity, Residency, and Address. Entity and Address have a many-to-many relationship; Residency is the junction object (two master-detail relationships.). Is it possible ...
1
vote
2answers
41 views

Is it possible to have multiple parent with one child relationship in Salesforce?

I have one object that contains fields that stored decimal and it already have Account as parent object.Because I want to Roll up Summary to do calculation on that (SUM) those field,I need to create ...
4
votes
4answers
112 views

Trying to get a SOQL query with no duplicates

EDIT: Is there a way where I could just loop through my list and remove the duplicates? It should be easy but I've been having trouble with it. I have tried a bunch of different methods of getting ...
2
votes
1answer
46 views

SOQL Query to count only Accounts with Opps in both this year and last year?

So rather than create an Apex class, run multiple queries then write some code to figure out the answer, I thought I'd take a stab at writing a complex query that would get me the answer I'm looking ...
3
votes
2answers
36 views

Is it possible to get the “type” of object you're querying in a SOQL relationship query

For example, in the standard Salesforce Event object, I'd like to do the following with the WhatId field. select what.name, what.type(?) from event where id = 'myid' However, this will only work if ...
0
votes
1answer
27 views

Help with formula field needed

The population of ABC fields depends on field__r.Account__r.Name field. I want to assigned ABC formula field with field__r.Account__r.Name value if field__r.field__c is blank, but if there are some ...
2
votes
1answer
43 views

Are lookup fields on the User object (e.g. to Contact) supported by the platform?

Aim – i need to have a lookup field on the user object which looks @ the contact object and only returns values where the email address is @domain.com Now i am under the impression that no lookups ...
2
votes
0answers
52 views

What is the logic for the automatic creation and update of custom report types?

It seems there is a lot of magic behind custom report types. For example, if I create a new master detail field to the account object for "Custom" a new report type "Accounts w/Custom" is created ...
2
votes
2answers
30 views

Do I have to manually call an update in a trigger for an object the trigger is NOT on?

I've noticed in triggers it is not necessary to use CRUD calls as it is in apex classes. However if I am updating a field on a different object to the one the trigger is on, do I need to do it then? ...
1
vote
1answer
54 views

Need Help on Cross Object Look Up Field Update

I finally have the Ids query corrected(after 20 years); Select (Select ParentA__c From ChildA__r) From ParentB s WHERE Id IN (Select s.ParentB From ChildB s) I now have the IDs I would need to ...
2
votes
1answer
243 views

Relationship between Account and Opportunity and Account and Contact

On Opportunity there is a lookup relationship to Account.But why it behaves as Master-Detail as we can create Rollup Summary Fields on Account. Similarly if we delete Account then Contact gets ...
2
votes
1answer
14 views

How to view inbound relationships

Working with a very large and complex salesforce setup, we have a custom object with several lookup fields to external objects. These are easy to check. I was hoping there would be an easy way to ...
2
votes
2answers
218 views

Related Object Fields in custom button (URL Hack)

Having a real brain freeze here. I am using some URL hacking to auto fill some fields on a custom object. USE CASE I have a custom object 'Operations Action' that is related to a case. My Case ...
0
votes
1answer
28 views

Selfrelationship of account

How to define self relationship in salesforce explain how can i create self relationship in salesforce. I know salesforce doesn't provide out of the box this relationship. My Scenario is i have a ...
0
votes
1answer
30 views

Understanding ChildRelationship object

I am using the C# web-service to get data from salesforce, After calling the "sforceService.describeSObjects()" function, I am running on the object and get they ChildRelationships. For example, I ...
1
vote
1answer
47 views

Is it possible to use SObject Formula fields to get arbitrary values stored in some other SObject?

Let's say I have some SObject (myCode__c) with three string values (e.g. key1__c, key2__c, and code__c). The combination of key1__c and key2__c should be unique. Let's say I have a second SObject ...
1
vote
1answer
241 views

How to default parent fields when displaying new child object VF page

I have created a custom lookup field on the Order object to the Opportunity because we want to create Orders from Opps and not Accounts. I have also created a Visualforce page for Orders and am ...
2
votes
1answer
74 views

Better way to fetch a User field from the a record's ownership?

Sorry if this has been asked before, but I feel that there has to be a simpler way to get a User field from the Owner relationship. I'm currently looping through 2 lists and then mapping the objects ...
2
votes
2answers
227 views

How do I return Manager name instead of ManagerID in a SOQL query?

I am running the following query: SELECT Name, ManagerID FROM User The result yields a User's name and their corresponding Manager's user ID. How can I return the Manager's name instead of the ID ...
1
vote
3answers
153 views

Error counting Child records

I have a parent object Feedback that has multiple Feedback_Comments as child(lookup). I have counted total Feedbacks grouping by name. But I'm unable to count the childs grouping by name. Here's what ...
4
votes
2answers
291 views

SOQL Outer Join Multi Level Master Detail Relationship

I am working with a 3 Level Master Detail Object Relationship: "Level 1" has "Level 2" detail records "Level 2" has "Level 3" detail records I am trying to Query "Level 1 records" and using an ...
1
vote
1answer
215 views

How to link Single Contact to Multiple Account?

How can we link single contact to multiple Account. I have seen many links related to this issue but couldn't get any idea. Is there any work around for creating multiple Account for single Contact. ...
1
vote
1answer
64 views

Is it possible to automate junction object creation?

Example use case: I have three objects: Order, Item, and OrderItem. OrderItem is the junction object that relates Orders to Items (because an Order can have many Items) and Item to Order (because an ...
1
vote
2answers
73 views

Trigger to update grandchild records

How do I update a grandchild's field if there is a change in grandparent field? I know I have to write a trigger because its cross object I can access the immediate child record of parent which is ...
1
vote
1answer
573 views

Accessing child records in visualforce

I have an object Feedback_Comment__c which lookups to Feedback__c. How can I access "Feedback_Comment__c" fields in a datatable column? I could pull all Feedback__c fields like this... ...
3
votes
2answers
263 views

Cannot access owner fields in new instance of child object even though OwnerId is populated

I have CustomObject__c that has the standard Owner field (which is a lookup field to a User). My code is the following: User myUser; //assume I've populated myUser as a result of a SOQL query or ...
4
votes
1answer
162 views

activity aggregate relationships only allow security evaluation for non-admin users when a single parent record is evaluated

I am getting the following error when I run a Salesforce SOQL query with a standard account. Query: SELECT ( SELECT Id, Subject FROM OpenActivities ORDER BY ActivityDate ASC , LastModifiedDate DESC ...
1
vote
1answer
70 views

How do I insert a list of related line items in apex?

I am creating a visualforce page and a custom apex class for a page that allows users to convert opportunities and opportunity line items into service contracts and contract line items. I've got all ...
3
votes
1answer
180 views

Relationship Query to Get All Events Associated with Account

I have the following query that works for getting all the Tasks and Events for a Lead. [SELECT ID, activity_count__c, (SELECT ID FROM Tasks WHERE Status = 'Completed'), (SELECT ID FROM Events) FROM ...
2
votes
0answers
93 views

Problems querying on KnowledgeArticle related objects

I'm trying to issue some SOQL which will return a KnowledgeArticle along with it's KnowledgeArticleVersion, ViewStats, and VoteStats. According to the Knowledge data model I should be able to do this ...
3
votes
1answer
48 views

Task Relationship Issue

I know that task is associated to a custom object by using the "WhatID". I need a filter based on if the task exists or not. For example parent__c and task: [select id, (select id from tasks) from ...
4
votes
1answer
121 views

DescribeSObjectResult contains fields of type reference with an unknown relationship name

I use the SOAP API (WSC, partner wsdl) to describe objects and use the field meta information to dynamically build SOQL queries. Today i observed that DescribeSObjectResult can contain fields of type ...
3
votes
3answers
95 views

SOQL - How to obtain Parent Name of CombinedAttachments

I am unable to obtain the Name of a Parent object, where the child is CombinedAttachments. The SOQL I use is listed below and works as expected. Select (Select Id, Title, RecordType, ...
3
votes
2answers
237 views

No master-detail relationship in which the User or Lead objects are the master?

Why can't we create a master-detail relationship in which the User or Lead objects are the master, any particular reason?
4
votes
3answers
802 views

Difference between __c and __r?

I read this article for difference between __r and __c. But I still can't understand how is Hiring_Manager__c.Email will be different from Hiring_Manager__r.Email Can anyone explain this? Thanks ...
6
votes
6answers
2k views

Relationship between account and contact

I checked 'Account Name' field in Contact object. It appeared as a Lookup(Account). But when I deleted that account, contact also got deleted which tells me it is a master-detail relation. Can anyone ...
4
votes
1answer
968 views

Difference between a self relationship and Lookup relationship

With Self relationship you can reference the same object, at the same time you can create a lookup relationship and still refer to the same object. So when do you call a relationship as self vs ...
1
vote
1answer
122 views

SOQL to get SmallPhotoURL

I am trying to create a custom VF page that shows records from my standalone custom object in a list along with the picture of the user who created that record..like this (User's image is hardcoded ...
3
votes
2answers
281 views

How to find accounts with no child accounts using soql?

I have requirement where i need to process account which has no child but has parent and accounts which has no parent and child separately. I tried select id, name,(select id, name from Accounts) ...
2
votes
3answers
2k views

SOQL Subquery - Standard Parent, Custom Child

Can someone help me understand why Im unable to execute the following query? Is it something obvious? Custom_Object__c has a lookup relationship to Contact. select Id, (select Name from ...
4
votes
1answer
101 views

Triggering code on sObject Child Relationship actions

I have a scenario in which I would like to fire off some Apex functionality when an Attachment is inserted from an EmailMessage object (that is received via Email-to-case). The trouble is, it does ...
2
votes
1answer
212 views

trigger to update lookup fields in 2 object lookup fields

trigger to update lookup fields in 2 object lookup fields My requirement is : a) i am having 2 lookup fields in 2 different objects with fields with common fields "city" If i update a city using ...