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 ...
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 ?
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 ...
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 ...
0
votes
1answer
900 views

Roll up Summary via trigger for lookup relationship

I am trying to get this trigger to work but it is giving me an error and I am not able to figure out why. The error I am getting is "attempt to de-reference a null object) Why trigger? We have a ...
3
votes
0answers
2k views

Lightning Components: Using <force:inputField /> on a Lookup only works partly and use slds-input class override with default

Using a <force:inputField value="{!v.account.ParentId}" /> seems to have flaws running in a Lightning Community Issues Rendering: wrong/missing styles Link "Find more results" does not work ...
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
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
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 ...
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 ...
3
votes
1answer
4k views

How to pass default value for lookup in salesforce standard view page

I have a lookup field in standard page. when I click on a custom button in other page need to pass the default value for lookup field in my standard page. If I pass some field id and values in url ...
3
votes
0answers
906 views

lightning:inputField as lookup missing “New Record” option

Is it just me or is the lightning:inputField component missing the "New Record" option when it's rendered as a lookup? Right now I have to type a value in the lookup field, hit enter, and wait for ...
2
votes
1answer
6k 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 ...
1
vote
1answer
6k views

How to Give Default value to a LookUp field in salesforce

I am having 1 lookup field country. i want to set it with some default value on UI. How should i implement this?
1
vote
3answers
272 views

Querying loopup field in SOQL and getting (null fieldName) but the field is coming in direct query

I have 2 objects Case (Case) and LiveMessage Session (LiveText__Conversation_Header__c) when I am querying SELECT Id, Case.LiveMessage_Session__r.LiveText__EndedTime__c FROM Case I am getting ...
0
votes
1answer
43 views

How can I change this method to query my master detail object?

I am new to Apex trying to do some practice assignments and have gotten stuck on this junction object query. Task: Edit the current getUser() method to do the following: Return a custom object (that ...
0
votes
3answers
1k views

convert text field to lookup field in salesforce

I need to convert a text field to Lookup field on Object 'A' As we cannot convert directly so there is one approach is to create a one object 'B'and create a lookup field on object A.My Question is if ...
0
votes
2answers
3k views

Populate address field upon Contact lookup selection

I have about 2 weeks experience in Visualforce and Apex and I am having trouble with displaying an address field related to a contact object. I have a custom Order object called WIMS_Order_c. With a ...
2
votes
1answer
7k views

Difference between dependent lookup and lookup filter

What is the difference between a dependent lookup, required lookup filter and optional lookup filter. I found those three concepts in many tests of salesforce and i didn't understand it.
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 ...
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 ... /...
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 ...
3
votes
2answers
3k views

Can I get the mini layout hover to appear on any link, like it does for outputField for a lookup field?

I am trying to get the <apex:outputField> works as it works for a lookup field, which is a link pointing to the object and when you hover on it, it pops up with a dialog of the object info. ...
3
votes
1answer
1k views

How to create a list view the returns all the records related to a current user?

Question Assuming an object with a user lookup, how can I create a list view (standard, not VF) that returns all objects related to the current user? Background We've got a compliance object, 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 ...
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
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
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 ...
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 ...
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 ...
3
votes
1answer
354 views

Can ampscript determine if a DE exists or not?

Does anyone know a way to determine with ampscript whether a DE exists or not prior to doing a LookupRows()? In my case, the DE I'm looking up may or may not exist. And if it doesn't, I wanted to stop ...
3
votes
2answers
3k views

Setting lookup field to blank using Process Builder

Pretty similar to Set Picklist field to blank with Process Builder, is it possible to do this for lookup fields? The only workarounds I'm seeing is doing this in a separate flow, which kind of offsets ...
2
votes
2answers
770 views

Why doesn't File Location Lookup show attachments of Opportunity?

My opportunity has some attachments. I would like to send them via email. If I hit on "Attach File" button of "Send an Email" page, then File Location lookup filter window, dialog appears, however I ...
1
vote
2answers
9k views

Primary Contact for Account

Is there any OOTB way of having a Primary Contact for an Account? One idea is to create a custom lookup field for Primary Contact on Account object. However, it will need validation such as the ...
1
vote
2answers
367 views

Dynamic From Address & From Name

I am trying to pull the FromAddress and FromName, from a data extension but am not having much luck. I have setup a sender profile that looks like this: From Name: %%=v(@fromName)=%% From Address: %%...
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 ...
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 ...
4
votes
2answers
8k views

How can I use a formula field to retrieve a record in a lookup

I have created a lookup field between the Quote Line Items object and a custom Discounts object. I want to retrieve a certain discount dependent on discount code and product category. My Discounts ...
4
votes
1answer
295 views

How do lookup relationships work with force:data:tree:export? Don't know where to start

I'm trying to import and export data between scratch orgs using force:data:tree:export, and I'm having trouble finding documentation that explains how to handle lookup relationships. Lets's say that ...
4
votes
2answers
4k views

“maximum depth of master-detail relationship exceeded” Can't change from Look up To Master Detail

I have two Object, Current Relationship is Look Up I am trying change it to M-D. In change Field Type the field itself is "Grayed Out" with this Info. My Intial requirement was Master-Detail because ...
3
votes
2answers
233 views

How to stop invalid records showing in a filtered lookup

I have a custom object with a parent / child relationship to the account standard object. On the custom object I also need to be able to record the relevant contact. I have added a lookup to the ...
3
votes
1answer
1k views

How to obtain “Related Content” information in SOQL/APEX

EDIT: There were two questions earlier. I figured one out. Please see below We can have Attachment objects on custom object records but can we for example, associate a Salesforce File or Content ...
3
votes
2answers
595 views

Lookup displaying JavaScript error (Internet Explorer)

One of our user is receiving a JS alert when filling a lookup (from a custom object). error: { faultcode: 'soapenv:Client', faultstring: 'Attribute "xmlns" bound to namespace "http://www.w3....
3
votes
1answer
446 views

Access Id of Contact from lookup field

I'm working on an Opportunity trigger and trying to pull the ID of a Contact that's connected via a lookup field on the Opportunity object called "Inbound_Contact__c". However, when this gets ...
3
votes
2answers
2k views

Test class failing for simple default lookup value trigger

I'm having trouble with what should be a simple test class for a simple trigger. The trigger inserts the ID of an account named Retail into a lookup field on the opportunity named Project__c if that ...
3
votes
2answers
9k views

How to get to which object the field has reference

I have a wrapper class which contain some Object name. Now I am looping through a base object and want to check is the base object have lookup to any of these object. But when I pick the describe of a ...
2
votes
1answer
526 views

Lookups TO Big Object Workaround

Seen and tried Big Objects and seem great, except that lookups seem backward to me...I'm sure for a reason. Not looking for the reason. I want to see how I can lookup from a Custom Object record TO a ...
2
votes
1answer
36 views

Do standard lookups always follow: FieldName = RelationshipName + “Id”?

Can we say that all standard lookups/master-details/polymorphic fields follow a consistent naming convention across all standard objects? I'm talking about this pattern: field name = field ...
2
votes
1answer
958 views

How to disable or readonly lookup field in standard page

EDIT: On a standard page. NOT using VF page Is it possible to write a validation rule or any approach to make a field disabled once the user save? I have a page with couple of fields including ...