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 transform it to a reuseable app 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
- 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 with the same logical name to both Account and Contact 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