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

learn more… | top users | synonyms

2
votes
1answer
110 views

Circular Lookup Reference

We have two objects "Project" and "Project Members". Project is child of some other object with master-child relationship. So, we can't have "Master-Detail" relationship between "Project" and "Project ...
0
votes
0answers
12 views

Custom App Security Model

I have an app that has a number of custom objects that are linked with a master detail relationship model. The app needs to be generic as I won't know the security setup up front. The app is also ...
1
vote
2answers
32 views

Unable to create Master-Detail relationship field

I am configuring a many-to-many relationship between custom object and Contact. For this purpose I created a junction object. Next, I have to create 2 Master-Detail relations. One for custom object, ...
2
votes
2answers
105 views

Relationship between Opportunity, OpportunityLineItems(Opportunity Product), PricebookEntry, Product2 & Pricebookentry in Salesforce?

Correct me if am wrong in these relation Ship between Opportunity, OpportunityLineItems(Opportunity Product), PricebookEntry, Product2 & Pricebookentry in Salesforce. OpportunitylineItem is ...
0
votes
0answers
12 views

What are the criteria for being able to set object related data in memory?

First, all the background information I'm not entirely sure if Related Data is the proper thing to call this, but it's the best/most concise label I can think up. As an example, take the following ...
1
vote
1answer
39 views

Relationship Query issue

i need your help to understand my problem with a relationship query. I want to get all users with the role "ceo" so i tested the following query in the workbench: SELECT Id,Email,Name FROM User ...
0
votes
1answer
23 views

Lookup Filter with related fields that are more than one relationship away from the lookup object

I want to add a lookup filter for the lookup between Package Version and Release. So I just can choose Releases which are linked to the same Program as my related Package. This is not possible ...
1
vote
1answer
50 views

Filter for lookup on object in many-to-many relationship

I have two custom objects - A and B, which have many-to-many relationship, presented by a third custom object - A_B_Asoc. A ------> A_B_Asoc <------ B In Opportunity, I have a lookup to A, ...
2
votes
2answers
34 views

Relationships in SOQL

Background: I'm new to Saleforce SOQL Just installed FORCE.com Explorer to create and test quires which I will using on a third-party Dashbboard that supports SOQL. What I'm doing: I'm trying ...
0
votes
1answer
25 views

VF Controller Test not picking up Field on Parent Object

I have a VF Page for a Custom Object that asks a User for a PIN and checks it versus a field on the Contact Object which is it's direct Parent. This Controller Extension is used for 2 other VF Pages, ...
4
votes
1answer
24 views

Look up to Master-detail through MetaData API: “cannot add master-detail relationship due to existing data rows”

Trying to change the existing relation between A(Parent) and B(Child) from Look up to Master- Detail. Deploying "B__c.A__c" using ANT. Ran a query on B and made sure all B__c.A__c is populated (As ...
2
votes
0answers
27 views

How to subquery “Default Opportunity Team” when querying for User?

Cannot figure out the relationship name for Default Opportunity Team on User. List<User> users = [select id, name, // default opportunity team (select id, TeamMemberRole, ...
-1
votes
1answer
15 views

how to Achieve this one object have two master details relationships records

how to Achieve this one object have two master details relationships records i want more ...how i achieve this...using rollupsummary Please xplain briefly
0
votes
1answer
44 views

Check if a contact or Lead already exist in a lookup relationship

Supposed I have a guestList__c Object. Then I have another object called as guest__c which is related to guestList__c,Contact or Lead objects. From the name of the object itself, guest__c store the ...
0
votes
2answers
35 views

Access object fields in a query

I got 3 objects, BUnit__c, Row__c and Portfolio__c, with the following design Portfolio__c(Many)-----------(1) BUnit__c (1)-----------(Many)Row__c Portfolio__c object has a lookup to the BUnit__c, ...
0
votes
1answer
28 views

how many look up relationship in salesforce

how many lookup relationship can I create in salesforce? can you send me a link about this topic?
0
votes
1answer
29 views

fetching records on vf with two object with lookup relation in them in salesforce

i have two object Timeslot__c and Commercial_Slot__c i have a field name timeslot which is lookup in commercial_slot__c on timeslot__c i am feching timeslot records on vf page and also want the ...
1
vote
1answer
27 views

How to enter multiple contacts in one custom object?

I created a custom Object "Visit Reports" and would like to be able to pick all participants from the Standard object Contacts. I have entered several "Participant 1, 2, 3,..." lookup fields to ...
2
votes
0answers
20 views

Search in related objects fields

Is there a way to make a single SOSL query to search in fields of related objects? For example: "find all tasks related to accounts are named X*".
2
votes
1answer
39 views

Any reason not to use Lookups instead of Master-Details for Junction object?

To build n-m relationships one needs a Linker/Junction object with two references. The Salesforce documentation recommends two Master-Detail relationships. Is there any reason why not to use two ...
1
vote
2answers
47 views

Lookup Relationship: One to Many where Child can belong to Multiple Parent

I wish to have a Gym object that contain zero or more members as a related list. So Gym is the master and Member is the detail side - but the Member records does NOT have to be linked to any ...
1
vote
1answer
15 views

Accounts & Contacts Relationship - Where Defined?

In the schema builder diagram, there is a 1:M lookup relationship between Accounts and Contacts. However, I cannot find where this lookup relationship is defined. Is it under the ...
0
votes
1answer
40 views

How to get all participants from Event

How get all participant from each Event and check if they are leads or not? Is it possible with one query?
1
vote
2answers
47 views

Retrieve relationship values in SOQL query

Expense__c expenses = [select Owner.Name, Contact__r.Name, from Expense__c]; for (Expense__c i : expenses) { String expOwner = String.valueOf(i.get('Owner.Name')); String contact = ...
0
votes
2answers
34 views

error of __r job and joballocation

Error: Compile Error: Didn't understand relationship 'JobAllocation__c' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom ...
2
votes
1answer
49 views

How to display a list of related cases inside a pageBlockTable?

I have a pageBlockTable which has a list of custom objects (Project__c). I want to display a related list in the column of the pageBlockTable with the associated cases for each custom object. I've ...
1
vote
0answers
29 views

APEX , sobject based on multiple IDs

There are 4 custom objects (starting with CO_) in the below for loop which are all inter connected and this code is working as expected. prodId is the Salesforce ID of CO_Product__c which is passed as ...
1
vote
2answers
27 views

list of records without childs

am very new to coding stuff and I am creating a trigger to count the total number of child accounts and the total number of dependent child account with some code that I found in this page to emulate ...
0
votes
1answer
30 views

Working off the Quote in Visualforce, how can I access Contacts? Getting an unsupported complex expression error

The quote is associated with an account, and the account has contacts. I can access the account data just fine, but when I try to display any contact data then it fails with the following error: ...
4
votes
1answer
61 views

Query and Follow Owner Relationship on Tasks

I actually can't believe I've not come across this before now, but is there a way of following on the owner relationship on a Task to get some other field on the User object? For an example, say on ...
2
votes
2answers
40 views

User with no access to child object can create records?

I have two objects Parent__c and Child__c with parent-child relationship. OWD settings for Parent__c is Public Read/Write and for Child__c it is Private. The User1 has Read/Write/Delete/Edit access ...
1
vote
2answers
48 views

Query all accounts that is related to another account effeciently

I've created a custom lookup field for account object and I call it as primary_account__c. Now, I want to query all primary_account__c with its related account what is the best way to do it ? I've ...
0
votes
1answer
55 views

Dynamic Apex: find relations between sObjectTypes

I am trying to create a class that can dynamically execute its function independent of the sObjects and sObjectTypes provided. The class should check, wheter the sObjects provided do have existing ...
0
votes
1answer
40 views

Restrict the number of children in lookup relationship

How do we restrict the number of children to 1 in a lookup relationship?
0
votes
1answer
26 views

How do make sharing setting of a custom object be controlled by parent in a look up relationship

I created a custom object with a lookup relationship to opportunity. I want the sharing to be same for this custom object with that of opportunity.
1
vote
1answer
32 views

Can a Custom Object be parent to Contact records?

I am contemplating how to create a custom object to hold account information and then associate the related contacts to this custom account object. Can contact records be re-parented or related to ...
4
votes
2answers
112 views

Invalid foreign Key error

I keep getting this error on this code and i am not sure how to fix this. Invalid foreign key relationship: Lead.channel_sales_manager__c The line with the errors is in * trigger leadassign on ...
0
votes
1answer
33 views

Insert Contact then auto create an opportunity in NPSP

Good day everyone, My problem is something related on how NPSP works. Suppose I have 2 group of data, one is CONTACT and one is OPPORTUNITY. What I want to achieve is that I want to insert those 2 ...
-1
votes
1answer
74 views

SOQL for Many to Many Relationship

I have a many to many relationship between Opportunity and custom_object__c with the junction object junction_object__c. Now I have to frame a query to pull all the related/attached ...
1
vote
1answer
21 views

Restore records from local backup using SOAP/BULK

I'm working on the restoring records for multiple objects that are stored in my local backup in the form of a database table. There seems to be an issue how the restore works. The scenario is as ...
6
votes
2answers
79 views

SOQL Query to retrieve Contacts from an Account sorted by the distance between the contact location and the account location

I'm trying to create a SOQL query to retrieve Contacts from Accounts, with the contacts for each account sorted by the distance between the contact location and the account location. This is what I ...
0
votes
1answer
94 views

To stop detail records deleted whenever master records deleted

Is is possible to stop the details records being deleted whenever corresponding master record deleted? If so can you pls provide solution.
0
votes
0answers
18 views

How would I set up this report?

I need to create a report that relates 3 objects. Account, Opportunity, And Lead. I am having troubles getting all the fields needed. Lead and Opportunity have a lookup to an account and it doesn't ...
0
votes
1answer
49 views

How to share objects with users in a many-to-many relationship?

I have a user to object many-to-many relationship and would like to give users read access to all objects that they are related to. In my data model there are three objects: User, Junction, and Foo. ...
3
votes
1answer
54 views

Find all records referencing a specific Account

What would be the best way to go about listing all the records that reference an Account? Lookup Ids aren't search indexed so SOSL turns up no results when looking for the Account Id and the only ...
1
vote
1answer
72 views

SOQL: Access Referenced object from a lookup field

I had an instance where I created a lookup field on a custom object (i.e. Sale__c) to reference an Opportunity, in which case this created a relationship for the Opportunity. Meaning I could now SOQL ...
0
votes
4answers
531 views

Updating a field with a value from parent during insert trigger

I would appreciate some best practice advice here - I have an insert trigger to populate a field in the record being inserted into a custom object with the value of a field in the parent object. ...
0
votes
1answer
44 views

Getting troubles with soql relationship in a custom object with a master-detail field

I have the next SOQL: SELECT Ap_Mat__c,Ap_Pat__c,Email__c,Cuenta__c,Nombres__c, Scheme__c FROM Asociado__c LIMIT 100 Where Cuenta__c is a master-detail field and Cuenta__c is the ...
1
vote
3answers
41 views

Polymorphic? Relationship to contact and user?

First post, but I think a valid question. I'm creating a family or household relationship between contact A and multiple contacts B,C,D... I am equally interested if a User E is also a family ...
0
votes
1answer
110 views

Collecting attendees onto Event Object

I want to collect the Attendees of events on to a custom text field on the Event object. I am running into issues collecting the names via the Event Relation. trigger EventAttendeeCollector2 on Event ...