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

learn more… | top users | synonyms

0
votes
0answers
12 views

Determine Master-Detail or Lookup relationship using SOAP API

I use describeSObjectResult() to get the child relationships of a particular object. This gives out childsObject, field, relationshipname, cascadeDelete as the field. I am supposed to frame the ...
1
vote
1answer
17 views

Need to access the Period for a custom fiscal year, when PeriodLabel is null when SOQLing on the Period object

We have a Salesforce org where they are using a custom fiscal year. The following results in a correct week number, but a null PeriodLabel: select Id, Number, PeriodLabel from Period When going ...
3
votes
3answers
137 views

Roll-up summary OR workflow

I have a parent-and-child-object scenario. The parent will have a TOTAL field and the child a VALUE field. I want to show a total of all child VALUES on the parent. I can either do that with a Master/...
3
votes
2answers
50 views

Accessing grandparent through SOQL

I'm trying to access a grandparent record through a SOQL query and am having some trouble. From my understanding, you can go 5 levels deep with a child-to-parent relationship in a query, so I don't ...
1
vote
1answer
23 views

Add component validation to avoid 'SObject row was retrieved via SOQL without querying the requested field' for grandchild

I want to create a component that can accept an SObject without requiring it to have all of the fields displayed on the component. However, when trying to access a grandchild, I am not able to render ...
1
vote
2answers
118 views

Lookup Relationship - traversal level?

I would like to know till what level can a lookup relation ship fields can be traversed. For master detail , I could find 3 levels . I tried this , but didn't work. select id , Lookup1__r....
1
vote
3answers
139 views

Can We assign a null value to an Master Detail relationship?

Can We assign a null value to an Master Detail relationship? It is required by default and hence while inserting to database it comes as Required Value missing? And if I try to insert some dummy value ...
1
vote
0answers
26 views

Dynamic Security?

I have a fairly complex app I'm building which currently has 24 custom objects, 20 of which fall into a Master-detail relationship at the moment but I think I'm going to have to change that. The ...
0
votes
1answer
21 views

mater detail relationship

There is a 'Communities' object in Salesforce that has a master-detail object called 'Baseline Surveys' below it (For every community, there can be several baseline surveys). However, a city lead ...
2
votes
2answers
77 views

Establishing Parent-Child Relationship via Process Builder

Here is my use case: A data load of applicant information must be inserted (no updates) into Salesforce. From this applicant information, a Contact record must be created with a specific record type ...
1
vote
1answer
36 views

Before Insert: Using __r to pull related data in a Trigger.New for loop results in nulls even though lookup relationship has Id

Situation: I am trying to build a custom validation rule via apex that will stop users from saving a charge item to a quote if the charge item exceeds the available product quantity. The charge item ...
1
vote
2answers
41 views

What type of object is the Event.Owner property?

I am struggling to understand the nuances of related fields. In my VF page for Events, I can access properties of the event owner like so: Event.Owner.Name, and Event.Owner.Type. Because of this, I ...
1
vote
1answer
38 views

How to SOQL query a Filtered Lookup on same Object?

I am trying to a subQuery for records of a specific Opportunity type that lookup via a Filtered Lookup, 'parent' Opportunities of another record type. This is the latest subquery tried so far: ...
1
vote
2answers
40 views

Relationships data not return when on UnitTest

I have been looking all over for a solution. What i have seen in other similar issues online is the error was related to code errors/user errors. I have looked over my code several times and cant see ...
1
vote
1answer
60 views

How to create an object with n number of children mapped to it

I have a requirement in which I have a parent and which could be related to n number of child, and all the child can have only single parent. What to do if I want to achieve this. If I do this ...
0
votes
2answers
50 views

Retrieving Dynamic SOQL results. Runtime error - “Invalid field Owner.Name for…”

I had a question in regards to dynamically retrieving the results of Dynamic SOQL that I have set up in my controller. I want to be able to access fields on the Lead object (Lead.Name) itself as well ...
0
votes
1answer
24 views

Parent-child query returns Aggregate Query Exception

I am getting all the contacts for the account and wanted to load it in a map Reference : Map<string, decimal> mapcol = new Map<string, decimal>(); for(Account acc : select id, (select id,...
1
vote
2answers
42 views

Display History tracking section in visualforce standardcontroller

I am using standard controller of a custom object called Enagements__c to display details of the record in VF Page. I want to use the standard feature of '<apex:relatedlist' and display all the ...
2
votes
1answer
76 views

Multiple upsert: Creating Parent and Child Records in a Single Statement Using Foreign Keys

The following is my Apex class to upsert the below input into salesforce. INPUT {"req" : { "tickets": [ {"External_TicketID__c" :"66", "Date_Time__c": "2015-09-13T22:30:00.000Z", ...
1
vote
1answer
33 views

Event parent relationship fields are null in trigger

I am populating a junction object on from Events and want to capture info from the Event but getting the Account from Account field pulls null. Same who the name via the Who. But if I query the Event ...
3
votes
2answers
68 views

Unable to create Master Detail Relatioship

I have some custom object - TestObj1, TestObj2, TestObj3.... TestObj1 - Only have 2 Master-Detail fields(With TestObj3 and TestObj4 Objects) TestObj2 - I have Master-Detail with TestObj5 now Why ...
4
votes
2answers
127 views

Junction object in Salesforce

What kind of relation should a junction object have with it's parent objects? What I know from Salesforce documentation: The junction object should have master-detail relationships with the parent ...
1
vote
1answer
66 views

Building custom VF approval page Query Issues

Some questions on displaying on what I can show in querying the Process. 1 - I am running into limitations on pulling in more fields in my query. public List<ProcessInstanceStep> getSteps() { ...
2
votes
0answers
44 views

Create Asset hierarchy in single REST API call - Parent and child assets

I would like to create Asset hierachy with a single REST API call, providing root Asset and his child Assets (Documentation). I can't do this because it seems that Asset.ParentId field doesn't have ...
3
votes
1answer
22 views

Are Sharing Settings of Relationship fields retrievable by Schema or Metadata/Tooling API?

Is there a way to find out in Apex code if on of the two radio options is set in an Org?
2
votes
1answer
26 views

Querying related objects

I have a relationship between objects as below: User->Contacts->Account->Parent I am trying to get the parent id using the following SOQL query: [Select user.contacts.account.parentid from ...
-1
votes
3answers
35 views

“update object.relatedObject__r” caused “Attempt to de-reference a null object” error in Unit Test

The code is working. Just to make it in Production, I need to do proper unit test to make sure the code coverage is above 75%. In the Controller Extension, I made a simple Page Reference to save the ...
0
votes
0answers
33 views

Junction object sharing rules in many to many relationship

While creating many to many relationship object A is read only & B is read/write. Object c is junction object. Can anyone explain which sharing rule will be eligible for junction object i.e. ...
3
votes
1answer
138 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
21 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
134 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
314 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
16 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
49 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
45 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
159 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
37 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
34 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
45 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
66 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
18 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
81 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
40 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
30 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
48 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
21 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
63 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
84 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
20 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 Customise/Accounts/...