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

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

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

Hancha
Resolver I
Resolver 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...

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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.

<
Users online (2,586)