Embedded Canvas Apps

Testing embedded canvas apps

Happy New Year 2020!

Coming after a short break, I am going to start off with a problem that took a good chunk of my time towards the end of last year, right before I was leaving for my vacation!

Embedded canvas apps, as we all know, are a very useful resource to bring the power of canvas apps to model-driven apps. However, creating and testing them can be tricky at times. One of those challenges was mentioned in my very first post (challenge #4) which can be found here.

In this example, I have a custom entity (called CustomEntity from here on) that has a field (called 'Owner Party') of data type lookup and related entity Contact. In a gallery of CustomEntity, I would like to display the related Contact's email and phone number. One would expect the following expressions to work to display the related Contact's email and phone number:

ThisItem.'Owner Party'.Email

and

ThisItem.'Owner Party'.'Address 1: Phone'

They actually do work (or at least seem to work) when looking at the embedded canvas app within the app designer/editor:

Embedded canvas app from within the app designer

Now, testing this app from within the model-driven form produces a completely diff result - the related contact's email and phone number are blank!

Embedded canvas app from within the model-driven form

To summarize, NEVER trust the results when testing your embedded canvas apps from within the app designer. Always go back to your model-driven app and see if the results are in line with the expectations. I will present the resolution for this problem in my next post, stay tuned!

Have fun! Get addicted!

Leave a Reply