web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Form Component Control...
Power Apps
Unanswered

Form Component Control and "source record not selected" error

(0) ShareShare
ReportReport
Posted on by 311

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?

I have the same question (0)
  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    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

  • tschopp Profile Picture
    311 on at

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

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    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?

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

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

  • tschopp Profile Picture
    311 on at

    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 Profile Picture
    311 on at

    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!

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    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

     

  • tschopp Profile Picture
    311 on at

    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.

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    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

     

     

  • Hemant Gaur Profile Picture
    on at

    Thanks @DianaBirkelbach  for looping me in.  @tschopp  can you please attach a solution for the issue for easy repro.

     

    thanks,

    Hemant 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard