cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

How to populate a field on a newform with data from a detailform where the addcontrol originated?

I am trying to make a powerapp based on Dynamics 365 Sales-data. I started with an app based on the account dataset. On the Account DetailScreen I am trying to make an add-control to create a new opportunity for the account. I want to autopopulate the accountfield in the opportunity with the account that was shown on the Account DetailScreen, but am not succeeding.

 

So far my formula is as follows

NewForm(NewOpportunityForm) ; Navigate(EditOpportunityScreen , ScreenTransition.None , { _parentaccountid_value : accountid } )

 

The NewForm and Navigate parts of the formula work. The update field part does not. Adding Account. or ThisItem. before the column name accountid does not work eather.

 

Anny suggestions how to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Level 10

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

Hello Rebekka,

what you need to do is to change the Default property of the account field datacard (or the Default property of its main control, which should be a text input or a dropdown) of the NewOpportunityForm.  You may need to unlock the datacard in order to be able to edit its properties or those of its controls.

 

The Default property will need to be set in such a way as to pick up the accountid from the AccountDetail screen.  How this is done depends on how you select the account in the AccountDetail screen and what context variables contain this.  Is it accountid?

 

If so, then you correctly set the _parentaccountid_value to account id as you have done.  The Default property then should simply be set to _parentaccountid_value

 

Please let me know if this works, and if it has not, then additional details /screenshots to be able to help you.

4 REPLIES 4
Meneghino
Level 10

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

Hello Rebekka,

what you need to do is to change the Default property of the account field datacard (or the Default property of its main control, which should be a text input or a dropdown) of the NewOpportunityForm.  You may need to unlock the datacard in order to be able to edit its properties or those of its controls.

 

The Default property will need to be set in such a way as to pick up the accountid from the AccountDetail screen.  How this is done depends on how you select the account in the AccountDetail screen and what context variables contain this.  Is it accountid?

 

If so, then you correctly set the _parentaccountid_value to account id as you have done.  The Default property then should simply be set to _parentaccountid_value

 

Please let me know if this works, and if it has not, then additional details /screenshots to be able to help you.

Anonymous
Not applicable

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

I found out what the problem was. The addcontrol was not properly set to the AccountViewForm. Instead it was set on the screen. So it missed context. When I moved it to a card on the form problem was solved.

Meneghino
Level 10

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

OK, glad you got it solved

Anonymous
Not applicable

Re: How to populate a field on a newform with data from a detailform where the addcontrol originated

I think there is a bug somewhere, because it stopped working all of a sudden. Weird.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 4 members 5,137 guests
Please welcome our newest community members: