lookup field data not populating on the skuid page

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Hi Community,

I have a custom lookup field. When creating a new record, i am populating the the lookup field and after saving the record i am not able to see the lookup field value on the detail page.

I don't understand what is going wrong here. This is very basic and worked on so many look-up fields but i never came across an issue like this.

Can anyone tell me if i have something to correct?

Thank you.
Photo of Avinash

Avinash

  • 1,726 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Avinash,

Can you describe this page and process in a little more detail? When you're creating a new record on object A and saving it, are you then expecting the lookup relationship to show up on object B's record? Depending on how your page is set up, you may just need to re-query the relevant model. 
Photo of Avinash

Avinash

  • 1,726 Points 1k badge 2x thumb
Hi Mark,


I have a Wizard component where in the second step ill populate the fields related to master object. Once i hit the next step button i will taken to the detail object layout (Within the wizard) by creating master record. Here i will fill in the detail objects fields and will save it. This way i'm saving both master and detail object records. But when go to its detail view, i don't see the lookup field populating.


The actions i have on the next step button (layout where master object fields are showed) is

1. Saving the master Object's model changes.

2. Navigate to next step.


Is there anything i need to add here?


Thanks.
(Edited)
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
You may need to requery the detail object's model after saving the master object's changes, so your page can see the new relationship that was created. 
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb
By master and detail objects do you mean parent and child relationship objects?
Photo of Avinash

Avinash

  • 1,726 Points 1k badge 2x thumb
Yes. Parent and child relationship.
Photo of Avinash

Avinash

  • 1,726 Points 1k badge 2x thumb
Hi Mark,


I added re query action on the save button within the wizard component. But no luck.


i want to mention some thing here.

If you look at the below screenshot, There are two Look-up Fields. One is Requested By and the other is Manager name. Requested By is populated whenever with the logged in users name. and Manager name field is manually entered by looking up in to the user object.



Now, when i open the Detail page, i am getting the following view.


here the requested by is populated properly but the Manager Name field id not populating. But if i look at the record in its classic view i see the name on the Manager Name Field.

Is there anything more i have to do to resolve this issue?
(Edited)
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
What does the Manager Name field look like on the model itself? It sounds like this field is being pulled into the Skuid page in a way that's making it read-only. 

For example, if I want to create a new Contact record, and associate it with an Account record, I would use the AccountId field on the Contact object for this. If I were to try and save the Contact record with changes to Account.ParentId or Account.Id, it wouldn't work because this method of bringing in fields from a related object provides read-only access.



Another possibility: If both of the fields you highlighted in the above screenshot are set up in the same way, and one field is being saved while the other is not, you may need to look at the way the fields themselves are set up in Salesforce, and compare the permissions and security settings to see if the Manager Name field has any settings protecting it from receiving changes. 
Photo of Avinash

Avinash

  • 1,726 Points 1k badge 2x thumb
So, Manager Name is a custom lookup field. It is looking up on to the standard user object.

Generally there shouldn't be a problem to display the User sObjects data.

Also The manager field is not read only. Because when i click on the field i see the User ID popping up. It looks like this


Now even if i manually populate the name and save it, it is not showing the name on the page (The name is hidden).
This is really weird.
Photo of Avinash

Avinash

  • 1,726 Points 1k badge 2x thumb
Hi Mark,

i exactly don't know what the issue is but just now i created a new lookup field with the similar behavior and it is working absolutely the way i wanted. This is totally weird. This to me sounds like, two custom fields with same behavior. but one among them is not working.

Anyways my issue was resolved. Thank you very much working with me on this issue.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
If you're attempting to create a lookup to the Standard User Object, unfortunately it sounds like Salesforce does not allow that kind of relationship on the User Object. More information can be found here.

I'm pleased that you were able to find a solution - would you mind describing what you did differently?
Photo of Avinash

Avinash

  • 1,726 Points 1k badge 2x thumb
Sure.
I was trying out different things and as part of it, i created a new custom lookup field looking up to user object. that's it. It worked. I see the value i entered during the record creation showing up in the detail page

This is not the first time i'm linking a custom field to Standard user objects data. Every time i created such a lookup relation, it worked. But I still couldn't figure out why that particular field failed to populate the field value. I checked the field permissions and everything looked same.