cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hancha
Helper I
Helper I

Embedded Canvas App Edit Form Combobox not showing Defaultselecteditems

Hi, 
I´ve spent hours going through similar issues in the forum but no suggestions seem to work for me.

My situation:
I have embedded app in Dynamics 365, on Opprotunity form.
The app itself has an Edit form with a combobox. The field Opportunity.TravelAgency is a lookup into another entity called Travel Agency, whose ID column is also called Travel Agency...

combobox/Items: SortByColumns(Choices([@Opportunities].in_TravelAgencyId),"in_name")

For the DefaultSelectedItems I´ve tried the following but nothing seems to work. Even though Opportunity.TravelAgency is not blank, my combobox default value remains empty.

My attempts on DefaultSelectedItems:
0) when the form was created there was Parent.Default - not working
Attempt1: 

Filter(
'Travel Agencies',
'Travel Agency' = ThisItem.'Travel Agency'.'Travel Agency').in_name
Attempt2):
Filter(
'Travel Agencies',
'Travel Agency' = [@ModelDrivenFormIntegration].Item.'Travel Agency'.'Travel Agency').in_name
Attemtp3)

Filter(
[@Opportunities].in_TravelAgencyId,
'Travel Agency'=ThisItem.'Travel Agency'.'Travel Agency').in_name

Will be grateful for any advice
Thanks





1 ACCEPTED SOLUTION

Accepted Solutions
Hancha
Helper I
Helper I

Got it right, finally.

LookUp(
Opprotunities,
Opprotunity = [@ModelDrivenFormIntegration].Item.Opportunity).'Travel Agency'

i.e. I´m looking through the Opportunity entity not the related Travel Agency entity...

View solution in original post

4 REPLIES 4
v-bofeng-msft
Community Support
Community Support

Hi @Hancha :

Could you tell me :

  • What is in_TravelAgencyId?Is it a lookup column related to Travel Agencies?
  • Dose the combo box allow multiple selections?I assume it allow multiple selections.

I assume my guess is correct.

Firstly,let me explain why you encountered this problem.

The point is that the data structure of

SortByColumns(Choices([@Opportunities].in_TravelAgencyId),"in_name")

and 

Filter('Travel Agencies',XXXXX).in_name

are different.

The value of 

Filter('Travel Agencies',XXXXX).in_name

is an one-column Table.

Secondly,I suggest you to remove the ".in_name" and try again.Something like:

Filter('Travel Agencies',XXXXX)

Best Regards,

Bof

Hi @v-bofeng-msft,
thanks for the promp reply.

  • What is in_TravelAgencyId?Is it a lookup column related to Travel Agencies? YES, precisely.
  • Does the combo box allow multiple selections? NO, it can´t as each opportunity can have only one travel agency
    It´s a Single layout combobox and the primary+ search field are both Name (in_name)

    I tried removing the dot structure (.in_name) but without any success.
    Again I tried all of them:

    Attempt1: 

    Filter(
    'Travel Agencies',
    'Travel Agency' = ThisItem.'Travel Agency'.'Travel Agency')
    Attempt2):
    Filter(
    'Travel Agencies',
    'Travel Agency' = [@ModelDrivenFormIntegration].Item.'Travel Agency'.'Travel Agency')
    Attemtp3)

    Filter(
    [@Opportunities].in_TravelAgencyId,
    'Travel Agency'=ThisItem.'Travel Agency'.'Travel Agency')

    I also tried replacing Filter for LookUp but no success.

    It´s frustrating and this can be a real business problem: if the customer have had filled the travel agency in during a different procedure on the Dynamics/Opportunity form and then the app wants them to fill it in again instead of taking it from cds....



     
Hancha
Helper I
Helper I

Btw. I aslo tried (for DefaultSelectedItems):
Parent.Default,
[Parent.Default],

[@ModelDrivenFormIntegration].Item.'Travel Agency']
but with no success...

Hancha
Helper I
Helper I

Got it right, finally.

LookUp(
Opprotunities,
Opprotunity = [@ModelDrivenFormIntegration].Item.Opportunity).'Travel Agency'

i.e. I´m looking through the Opportunity entity not the related Travel Agency entity...

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,920)