Questions tagged [lookup]

This type of relationship links two objects together. Lookup relationships are similar to master-detail relationships, except they do not support sharing or roll-up summary fields.

Filter by
Sorted by
Tagged with
14
votes
1answer
992 views

Set Relationship Via Name Pointing Field?

One of the most startling things I ever learned from @BobBuzzard is that you can update a lookup by using the name pointing field. At least, I thought that's what I learned, until a recent debate cast ...
12
votes
3answers
3k views

Do child/parent relationship names need to be unique?

Don't all child relationship names on an object need to be unique ? I know they need to be unique if it's a relationship name on a parent to child relationship, but I thought they still needed to be ...
12
votes
3answers
1k views

Parents Whose Last Created Child is a 'Failure'

I have a lookup relation, so I need to filter Parents (id, Name) whose last created Child has status__c Failure. Tried something like: SELECT Id, Name FROM Parent WHERE RecordType.Name = 'rt' AND ...
12
votes
2answers
2k views

SOQL ignores : WHERE RequiredLookup__c = null

I just figured out, that SOQL ignores null checks on required fields. It seems to expect that required fields can never be null. In my case it's a new field, so a bunch of records actually have null ...
11
votes
2answers
35k views

How to write a rollup summary trigger for a lookup relationship

Is there anyway to update a rollup summary field with lookup relation ship for a custom object. How can we achieve this using triggers ?
10
votes
2answers
1k views

Sort related list with null values last

Is it possible to have a related list sorted by a specific column while displaying the empty values last? By default, these are shown at the top of the list. The field i want to sort after has the ...
9
votes
1answer
6k views

Can force:recordData query related parent fields?

Anyone found a way to select parent fields with force:recordData? It would be great to have something like this: <force:recordData recordId="{!v.recordId}" targetRecord="{!v.child}" ...
9
votes
1answer
8k views

Why can't I create a master-detail relationship between Product and my custom object?

Trying to create a master-detail relationship between my custom object (detail) and the standard product object (master). Initially it said I couldn't create this because I needed to make sure all ...
8
votes
4answers
2k 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 ...
8
votes
2answers
2k views

New page - Parent lookup pre-populated?

I'm attempting to create the New button functionality on a visualforce page that will be hosted as a section of detailed page layout. This vf page will surface child records of a parent detail page ...
8
votes
1answer
3k views

Can you create a Lookup to a Task?

I do not see Task/Activity/Event as an option for a Lookup on my custom Lookup on the Case object. I know Tasks are treated differently than other object but I cannot find any documentation stating ...
8
votes
2answers
3k views

force:createRecord- to get the record Id and a call back?

I have implemented a Custom Lightning Lookup component which includes creation of a new record capability using force:createRecord. For this new record creation, I have a default option(New) at the ...
8
votes
1answer
2k views

Modify “New” Object Layout through Lookup

When using a Lookup field, you can create a new object utilizing the "New" button. My first question, what is this functionality called officially by Salesforce? Can you turn it off? Secondly, when ...
8
votes
2answers
5k views

Create a record in an object with lookup fields through java soap

I am pretty new with Salesforce and I am doing an integration where I have to update Salesforce with data from a Business System. I have a problem when trying to create new records in an object with ...
8
votes
2answers
2k views

Can't get ID from lookup field using ActionSupport

I have a Visualforce page for creating new Cases. During this process, I want to retrieve the contact's mailing address whenever the contact lookup field is changed. I'm using ActionSupport but it's ...
7
votes
2answers
14k views

Is it possible to convert a Master-Detail relationship to a Lookup?

I'm going through the Trailhead training (here), and see the following two snippets which seem to disagree: "It’s possible to change a lookup relationship to a master-detail relationship, but not ...
7
votes
2answers
15k views

Trigger to autopopulate a lookup field via related record

I have a custom object in salesforce. Every record has many fields. One is a lookup field in which we select an opportunity from lookup. What we want is another lookup field: Account__c which has to ...
7
votes
1answer
20k views

Create VisualForce input that uses Lookup popup

I have a custom object, Foobar__c, and I would like to create a VisualForce page containing a form in which the user has to select a Foobar__c via the standard Lookup popup for Foobar__c. I would ...
7
votes
4answers
4k views

Salesforce1 - How to Enable the Standard Lookup Field Search on a Mobile VF Page

We have created a couple of VF pages that are Mobile Enabled. These VF Pages have 2 Lookup fields each. The problem I"m having is that on Android, I cannot open a search to find the records and on ...
7
votes
1answer
2k views

How to implement Lookups in Lightning Components?

Assume you have a Lookup or Master-Detail relationship defined in the metadata and now you need a simple UI. In Visualforce lookup-controls on the UI run out-of-the-box using <apex:inputField ... /...
7
votes
1answer
964 views

Salesforce URL Hacking - Ability to remove the 'multiple items found' error

I've created the following custom button on my custom object to automatically lookup the contact and account names when the custom 'new' button is selected from a contact's related list: /a0H/e?...
7
votes
2answers
2k views

Nested SOQL Query On Object w/ Lookup To Same Object

I have an object, Widget__c. This object is very simple, but it has a lookup to Widget__c as well, as each object can be nested within another. Now, I need to query and get the entire structure of ...
7
votes
4answers
3k views

Bulk API & Foreign Key Resolution on Lookup Fields

We are designing an Integration leveraging Bulk API & Enterprise WSDL (The client code is handled by the source system). The target Force.com Object has few Lookup Fields. Wanted to understand how ...
7
votes
1answer
90 views

Programmatically Determine Which Objects Allow Lookup References to Them?

I'm wondering if there is a way, via apex, to retrieve all objects that would allow a lookup field on another object to reference them. For example, for a custom object obj1__c, I can create a lookup ...
7
votes
1answer
529 views

Lookup popover freezing in place

I have a custom Visualforce page that includes a dynamically sized table. The first column in the table is a Lookup to Account. When that value is chosen, some logic is run to populate some of the ...
6
votes
2answers
8k views

How to add a lookup field value to an sObject list

Since I started coding in Apex, I've gotten used to working with lists of IDs of objects not the objects themselves. This time around, instead of creating a List<ID> of account ids, I created a ...
6
votes
2answers
9k views

How to popup your own lookup?

I have a page full of apex:inputfield tags. On one of these inputfields I'd like to popup my own lookup window. What should my approach be? It seems that apex:inputfield is bound to a data field, ...
6
votes
2answers
1k views

Lookup Filter “OR” Condition

I would like to start using a filter on one of our lookup fields. The lookup field is simply a lookup to a contact. However, I need the filter to have an OR condition (e.g. only allow contacts from ...
6
votes
3answers
15k views

Check lookup field is null in apex

What is the best approach to check if a lookup field is null in apex? rec.lookupField__c == null; // OR rec.lookupField__c == ''; // OR String.isBlank(rec.lookupField__c ) // ? I ...
6
votes
2answers
722 views

Can an ID in a lookup field ever be invalid? Anywhere?

Salesforce documentation gives the following rules for non-mandatory lookup fields: When the target is deleted, by default fields that reference it are set to null. You can tell it to prevent ...
6
votes
1answer
6k views

Access related object via lookup field in email template

I have one object called Service Request, them I have a lookup field of Account with retrieves me the name. In my email template I must show up: Account: _______ & Account Code:______ My ...
6
votes
1answer
741 views

How to access the lookup field's hidden Id with javascript

I have a visualforce page to do some CRUD operations on a custom object, which contains a lookup field to the account. I need to do some client side validations with javascript based on the Id of the ...
6
votes
1answer
2k views

Lookup filter on visualforce page

I have a Custom Lookup field for Account and Contact on visualforce page After Selecting Account from 1st lookup field when i click the 2nd lookup field for Selecting Contact it should display ...
6
votes
3answers
2k views

Lookup window not closing after selecting the value in result

I am trying to get the native lookup window to open up and when the value is selected needs to populate a hidden field. I am able to call the lookup function, but when i select the value nothing ...
6
votes
1answer
353 views

Cross-object Lookup Between Custom Objects

I am fairly new to Salesforce, and keep running into its many limitations. I am just trying to make a Lookup field to find what category the item on my Invoice Line object has. The category field is ...
6
votes
1answer
658 views

Account lookup on Opportunity not filtered correctly from Visualforce page

Visualforce Our organization uses a Visualforce page to override the New Opportunity action. Below is a functional sample of the Visualforce page that specifies the Account lookup field and ...
6
votes
1answer
382 views

What happens to Master-Detail after deleting (Managed Package)

When I delete a Master-Detail relationship in my managed Package Will it be replaced by a Lookup, like this Knowledge arcticle says? Will there still be a Master-Detail relationship in our customers ...
6
votes
1answer
740 views

Spring'16 issues with lookup-fields on <force:recordEdit> in standalone LightningApps and LightningOut

I'm trying to use <force:recordEdit> on a Visualforce page via Lightning Out. But there seems to be some rendering issues. Using a standalone Lightning App it looks like this: Using ...
6
votes
4answers
2k views

Limit for Related Look-up Lists

Suppose let's say I have 100 custom objects, and they all have a look up relation with Contacts. Are so many related lists supported? If so, can anyone give the max number of look-up lists supported ...
6
votes
1answer
967 views

Is Lookup Auto-Completion really restricted to recent items?

We are using the Salesforce search setting "Lookup Auto-Completion" which provides auto-completed options as-you-type in lookup filters on your visual force pages. The suggested results that pop-up ...
6
votes
1answer
834 views

Default Asset lookup field in Cases doesn't display every Assets

One of our user noticed that the default Asset lookup field in the Case isn't displaying every Asset tied to an Account in our organization. I verified that there were no lookup filter preventing ...
5
votes
1answer
4k views

What are the implications of using a reparentable master-detail relationship instead of a lookup?

Since the Summer 12 release of salesforce it's been possible to set the "Allow reparenting" attribute on master-detail fields. This somewhat blurs the traditionally clear line of when to use a master-...
5
votes
1answer
8k views

Do cross object formulas only work if the lookup field is on the same object as the formula field?

I have recently been using cross object formulas (I'll use COF for notation) for the first time, and as far as I can tell the only way to use fields from another object is if the lookup is from the ...
5
votes
1answer
4k views

Enhanced Lookups (All Fields)

Are custom lookup fields searchable with the (All Fields) Search Enhanced Lookup on a Custom Object? In this example: I have a "Well" (Custom Object) record that has a look up relationship to a "Rig" ...
5
votes
3answers
227 views

Lookup field value through query is gibberish?

I have a custom object (Team_Assignments__c) with a lookup relation (Team_Member__c) that references the User object. Team_Member__c should be the name of a user. However, my SOQL query for the ...
5
votes
1answer
707 views

Workaround to make Contact lookup field searchable

I believe the lookup fields are not searchable via Global search.. In the Case object we have contact as a look up field. When we search for a contact name in the global search it returns with 0 ...
5
votes
2answers
263 views

sandbox copy error?

I just did a full sandbox refresh. Spent a couple hours debugging code before I finally saw where the null pointer was coming from. In my production org, there's a custom object (position) with ...
5
votes
3answers
808 views

How to simulate cascade delete in trigger

I have two objects linked by a lookup. The objects are one-to-one and neither should exist without its counterpart. When one is deleted, I need the other to be deleted as well. My plan was to put ...
5
votes
1answer
2k views

How to set a Predefined Field Value lookup field by ID?

I created an Opportunity Action, using the OpportunityLineItem as the Target Object. I want to set a Predefined Field Value for the field PricebookEntryID. When I add a new predefined value, select ...
5
votes
1answer
4k views

Adding an ad hoc lookup to Visualforce page

I have a totally custom visualforce page, with a number of elements on it, backed by controller instance variables, and I'm using apex:inputField to successfully render them all perfectly. I now wish ...