Skip to main content

Notifications

Announcements

No record found.

Power Platform integration forum
Unanswered

Reusable Embedded Canvas App

Posted on by 3,962

What I initially deemed as a pretty easy task, now is giving me a headache to come up with a simple and clean solution/workaround. Basically I want to use an Embedded Canvas App which I previously built and make it more generic so it's reusable on 2 Main forms: 1 for Account and 1 for Contact. Depending on the entity type (Account or Contact) I want to execute some different logic in the canvas app.

 

What I've tried so far:

  • Try to dynamically set the Datasource of the ModeldrivenFormIntegration control => haven't found a working solution yet
  • Work with the ModeldrivenFormIntegration control to get the entity type (logical name) => not possible
  • Check if a field exists for ModeldrivenFormIntegration.Item => can't use functions like IsBlank() because Intellisense shows errors if a field doesn't exist for the current datasource of the ModeldrivenFormIntegration

Ideally I'd like to work with the ID of the current record, but as stated above then I should be able to either use ModeldrivenFormIntegration.Item.contactid OR ModeldrivenFormIntegration.Item.accountid, depending on the Form where the ECA is running...

 

I also don't want to duplicate the app with slightly different logic, just as a workaround for this issue. Adding an extra field of with the same logical name to both Account and Contact which contains the entity type also seems  like a dirty solution...

 

Has anyone stumbled upon the same issue before and found a clean workaround? Or am I missing something like a Power Apps formula which can help?

Would love to hear your feedback!

 

Cheers,

Frederik

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,773 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,513 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans