cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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.

View solution in original post

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.

View solution in original post

Highlighted
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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,306)