cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tschopp
Advocate II
Advocate II

Form Component Control and "source record not selected" error

In my model-driven app, I have a form for a table that has a Form Component Control on a tab.  That FCC is for the parent (1:n) table.  It works well, except that quite frequently I get a "source record not selected" message displayed instead of the parent table form.  If I refresh the page, the parent form displays and works fine.

 

It seems like a timing issue.  The FCC is trying to render before the lookup field it is applied to has a value populated.  Something like that.

 

Any ideas how I can get this to work more consistently?

1 ACCEPTED SOLUTION

Accepted Solutions
tschopp
Advocate II
Advocate II

I just got off the phone with Microsoft support.  They confirmed that it's a known issue and a fix is coming to my region (North America) in the 3rd week of June.

View solution in original post

16 REPLIES 16
DianaBirkelbach
Super User
Super User

Interesting @tschopp , 

I didn't saw that behavior until now, so it might be a special case (or a new issue).

Maybe the parent lookup is the first control on the page (so the focus is somehow still on the control)? I've seen weird issus for long time because of this (of course, not related to the FCC).
What if you set the value for the parent lookup using the console. Does it load then?
Kind regards,

Diana

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
tschopp
Advocate II
Advocate II

Thanks for the quick response!  What do you mean by "set the value for the parent lookup using the console"?

DianaBirkelbach
Super User
Super User

Just type something like Xrm.getAttribute(....).setValue(.,..)
Or maybe change the value for the parent using the control, and then change it back. Does it work?

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Do you have the parent lookup on the form, without having it rendered as a FCC?

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
tschopp
Advocate II
Advocate II

I do not.  Do you think it would make a difference if it was there?

I added some logic at the beginning on the onFormLoad javascript handler to get the value of the lookup and immediately set it again.  That seems to reduce the frequency of the error, but still happens occasionally.

tschopp
Advocate II
Advocate II

I added the parent lookup on the tab so that it's now there twice, once as FCC, once as default control.  That seems to make the error happen more frequently!

DianaBirkelbach
Super User
Super User

Hi @tschopp , 

I've tried to place a FCC for the ParentAccount on my Opprtunity form, but I cannot reproduce the issue. 
I've even tried to throttle my network connection, to see is there is something wrong.

 

1. Do you use the quick create form for opportunity, or the main one?


2. I understand that there might be something with asyncronous processes. Maybe it's not about showing the FCC too fast (usually it's the last I get displayed), maybe it's a script which deletes the parent in your oppotunity form. Maybe if you attach a script to OnChange for your parent lookup on the Opportunity form, and there make a console.log, you get to know if something happens.

3. Another idea would be to check if you have javascript registered on the parent table (entity) form.  Because that ones gets loaded too.
Maybe if you delete that (or try with a new, lightweight form without scripts) you get closer to the issue.


I'm going out of ideas. Of course it could be a bug too..
Hope this helps.

 

Kind regards,

Diana

 

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @DianaBirkelbach ,

 

Still having the issue.  Not sure if it matters, but I'm using 2 custom tables that have a 1:N relationship.

 

1. I'm using Main forms for both tables.

2. I tried adding script to the parent lookup OnChange event and it never fires.  I put a debug breakpoint in to be sure.

3. I thought this idea might be it because my 2 forms have quite a bit of javascript in use for several events, and lots of tabs on the child table form.  I commented out all OnLoad code and still got the error intermittently.  I tried creating 2 new forms, one for each table.  There are only 2 tabs on the child table form, 1 on the parent form and 3-4 controls on each form.  No javascript libraries associated at all.  I still get the error occasionally.

 

Not sure what else to try before going to Microsoft to report it as a bug.

DianaBirkelbach
Super User
Super User

Hi @tschopp , 

 

I have no idea what else you could try. It's still a preview, so for now is no guarantee, but maybe a bug report would help.

@HemantG : Is this a known issue or something somebody from the team would want to have a look to?

 

Kind regards,

Diana

 

 

Kind regards,
Diana
----------
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,914)