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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (63,766)