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

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 III
Advocate III

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 III
Advocate III

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 III
Advocate III

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 III
Advocate III

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Users online (1,298)