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
Solved! Go to Solution.
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...
Hi @Hancha :
Could you tell me :
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.
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....
Btw. I aslo tried (for DefaultSelectedItems):
Parent.Default,
[Parent.Default],
[@ModelDrivenFormIntegration].Item.'Travel Agency']
but with no success...
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...
User | Count |
---|---|
148 | |
93 | |
82 | |
77 | |
57 |
User | Count |
---|---|
197 | |
175 | |
103 | |
95 | |
89 |