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

learn more… | top users | synonyms

2
votes
1answer
23 views

Why does ProcessInstanceNode not appear in the Entity Relationship Diagram?

In the following linked image is the Salesforce ERD for Process objects: However I can't understand why I can use the following subquery to get a "invisible" child object for process: [select Id, ...
1
vote
1answer
17 views

Visual Flow - Count number of child records

I need to count the number of Assets per Account, in a roll-up summary field. My criteria is: Every time an Asset is created /updated, count number of Assets and store in field 'Number of Assets'. I ...
0
votes
2answers
21 views

Query with relationship fields

I read some other questions but I'm still having trouble. I' ve got Custom object A and B. A has got a LookUp relationship field on B named LookUpB__c. I'd like to get the value of Name of B. This ...
1
vote
2answers
38 views

Relationship problems in DML/SOQL

I am unable to understand relationships with DML/SOQL. Example, I have custom objects Course__c and Course_line_item__c. Course_line_item__c has a lookup field on it that points to Course__c. So this ...
1
vote
1answer
27 views

How to use fields API name's value computed by a formula field

I have a formula field which returns me a field's api name. I want to use that api name for further computation by retrieving the value stored in that field. The field whose api name is computed by ...
0
votes
1answer
10 views

Contacts with Multiple Accounts /Multiple Email addresses

I have a user requirement where a contact may need to be associated to multiple Accounts and store multiple email addresses based on the Accounts they are working for. For Example, Joe Blogs who ...
0
votes
0answers
22 views

Custom Button On Contract Object to Create Case Record [closed]

Is it possible to create a custom button on contract the will generate a case? And if so I assume I should be able to prepopulate some of the standard and or custom fields on the new case record. Also ...
0
votes
2answers
15 views

Retrieve all Cases related to Account object directly and indirectly on Visualforce page embeded in layout of account record

I want to show all related cases of account record in visualforce page embeded to layout. What is main issue? Standard Account object has related cases. Also Account has related Asset and Contact ...
1
vote
2answers
25 views

Limit results from subquery based on parent field

I'm trying to find the value of a specific field at the end of the month on the month someone subscribed. I'm having trouble with the where clause in the subquery. Adding a function on a field from ...
7
votes
4answers
264 views

How to identify look up relations to an object in Salesforce

I have a custom object and I would like to know which all other objects have look up relations to this one? There are many objects available and I cannot go into each and identify which would have ...
0
votes
0answers
26 views

ObjectA.ObjectB__c exists but ObjectA.ObjectB__r does not exist

I am working on a function to update the object related object's fields. e.g. function A () { ObjectA.ObjectB__r.FieldA__c = 1.1; update ObjectA.ObjectB__r; } Now I am writing the test ...
1
vote
2answers
43 views

Inserting an object with not writable field

I've this class that I need to test it: public class A800ExpiredClientReportV2 { Public ID quotID {get;set;} Public List<Quotation__c> quotList {set;get;} Public ...
0
votes
2answers
33 views

Compile Error: Didn't understand relationship 'opportunity' in field path

I'm attempting to create a report that maps activity on an account, by signalling whether certain 'capabilities' (services sold) stored as picklist values are selected on all related opportunity ...
0
votes
0answers
19 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
23 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
163 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
67 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
124 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
146 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
96 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
38 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
52 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
43 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
41 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
61 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
64 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
25 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
57 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
106 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
38 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
77 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
138 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
69 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
51 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
24 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
27 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
36 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
35 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
147 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
191 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
396 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
19 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
50 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
55 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
177 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 ...