Advertisements

Archive

Archive for November, 2019

Canvas App using Dynamics On-premise data

November 19, 2019 Leave a comment

Last week there was a question on my blog to check for the options to build a Canvas App which consumes CRM on-premise data.

To answer this, Power Apps has connectors (CDS and Dynamics 365) to communicate with Dynamics online but there is no built-in Dynamics on-premise connector.

However there are options to connect Canvas app with Dynamics on-premise, which are listed below.

Using ‘Gateway’ to connect to SQL on-premise DB:

  • This option is about connecting to Dynamics SQL DB using on-premises data gateway.
  • The on-premises data gateway acts as a bridge to provide quick and secure data transfer between on-premises data PowerApps.
  • Refer my blog on steps to use gateway and build a Canvas App.
  • Limitation:
    • With ‘Gateway’ option we can only view Dynamics data in PowerApps.
    • There is no way to add or modify Dynamics data using the current PowerApps gateways.

Using ‘KingswaySoft’ connector:

  • KingswaySoft SSIS Integration Toolkit for Dynamics 365 includes components to integrate with CDS.
  • Using the ‘CDS Connection Manager’ we can easily connect and bring data into and out of CDS.
  • Once data is in CDS, we will be able to leverage this data with PowerApps.
  • Any updated data being generated with PowerApps will be reflected in CDS which can then be retrieved and synced with your Dynamics on-premise instance.

Integrate on-premise environment with the CDS:

  • Its the same approach, ‘KingswaySoft’ connector leverages but this option is manual integration.
  • Integrate the on premise environment with the CDS–in effect setting up a hybrid environment, where you have a copy of your configuration in the cloud as well as your on premise CRM, and create a bi-directional integration to synchronize data changes between the two environments.
  • Limitation:
    • There will be potential delay for record changes to synchronize between the On-premise and CDS.

Refer the article for more details.

🙂

 

Advertisements

Dynamics/ADX Portal – Handling ‘Page flickering’ due to long running scripts

November 18, 2019 Leave a comment

In our portal, we have a couple of entity forms with JScript registered on page load event, which hide/show or enable/disable controls based on business rules.

Due to the script execution delays, end users were experiencing page flickering on load.

What is flickering:

  • If you have a script with hide/show control logic, on page load event, end user would see the unintended controls momentarily before your script kicks in.
  • Assume that you have an ‘Option Set’ field on Entity form, which you hide based on logged in user’s web role using jscript. What if there is a lag in your script execution, end user would see the ‘Option Set’ for a split second, before it gets hidden.

How to handle flickering in Portals:

  • We have added below statements in both the ‘Custom JavaScript’ and ‘Custom CSS’ to the portal Web Page’s ‘Advanced’ tab.

Portal_Loading

  • The above technique works on a simple rule;
    • Hide all the controls before the page loads (i.e., using CSS).
    • Let the script with your business rules executes.
    • Show the controls only when the Page load completes (i.e., using $(window).load event).
  • Lets dissect the statements added in ‘Custom JavaScript’ and ‘Custom CSS’.
    • #content_form is the OOB portal ‘form’ control’s object, available in all portal pages.

Portal_Loading_2

    • To hide all the controls, set the #content_form { display: none; } in ‘Custom CSS’.
    • Now, show the #content_form only when page load completes, by setting ‘display’ to ‘block’ in $(window).load event.

Notes:

  • Following are the events, as per their order, during any Web Page’s Load.
    • $(document).ready
      • document.ready triggers when the DOM is ready, e.g. all elements are there to be found/used, but not necessarily all the content.
    • $(window).load
      • window.load event is fired after whole content is loaded like page contain images,css etc.
  • We can also show ‘Loader’ symbol during page load. All we need is ‘Spinner’ image and hide/show using the specified technique.

🙂

 

Categories: CRM

Power Platform new announcements – Microsoft Power Automate, RPA and more

November 18, 2019 Leave a comment

In Microsoft Ignite 2019, following major updates to the Microsoft Power Platform were announced:

  • Microsoft Flow is being renamed to Microsoft Power Automate, to better align with the Microsoft Power Platform.
  • Robotic process automation (RPA) has been added to Microsoft Power Automate, delivering an end-to-end automation solution that spans AI, APIs, and UI on the Microsoft Power Platform.
  • Microsoft Power Virtual Agents—a no-code/low-code app that allows anyone to create and deploy intelligent AI-powered virtual agents.
    • Refer my blog for Virtual Agents Intro.
  • A host of new security enhancements for Microsoft Power BI, that add industry leading data security capabilities no matter where your analytics data is used and accessed.
  • Tighter integration between the Microsoft Power Platform and Microsoft Teams, bringing the world’s most popular collaboration app and the Power Platform closer together.
  • A new set of prebuilt models for AI Builder that add even more advanced AI models to Microsoft Power Automate and Microsoft Power Apps that are available to everyone.

Refer this link for more details and keynote

🙂

[Step by step] Basic Canvas app using Dynamics 365 as Data Source – Part II

November 13, 2019 Leave a comment

This article is continuation to the Part I where we had gone through the following steps:

  • Creating a basic Canvas app
  • How to add a Dynamics 365 Data source.
  • How to add a Gallery to show list of records
  • How to create a new record using ‘Form’ control

In this article, lets see how we perform the ‘Edit’ record by

  • Adding a new ‘Edit Contact’ screen
  • Adding an ‘Edit’ icon to the Gallery item
  • On click of ‘Edit’ icon, redirect to ‘Edit Contact’ screen

Design ‘Edit Contact’ screen:

  • Add a new screen to the Canvas app and rename it to ‘Edit Contact’
  • Add a form to the ‘Edit Contact’ screen by navigating to ‘Insert -> Forms -> Edit’
  • Rename the form to ‘formEditContact‘ and set below properties
    • Set ‘DataSource’ to ‘Contacts’ (i.e., Dynamics ‘Contacts’ Data Set Name)
    • PA_Edt1
    • Set ‘Item’ to ‘galContacts.Selected’ (i.e., Selected Item in the Gallery)
    • PA_Edt2
  • Add a Save icon to the screen and set ‘OnSelect’ as

SubmitForm(formEditContact);Navigate(ManageContacts);

PA_Edt3

  • In the above statement
    • SubmitForm(formEditContact) – Saves the content and updates the Contact.
    • Navigate(ManageContacts) – Post Save, redirects to ‘ManageContacts’ screen (i..e, Gallery screen)

Add ‘Edit’ Icon to Gallery:

  • Go to the ‘ManageContacts’ screen.
  • Select ‘galContacts’ Gallery control and click on ‘Edit Gallery’ icon.
  • Now add a new ‘Edit’ icon to the Gallery item.
  • Set ‘Edit’ icons ‘OnSelect’ as

EditForm(formEditContact);Navigate(EditContact,ScreenTransition.Fade);

PA_Edt4.PNG

  • In the above statement
    • EditForm(formEditContact) – Sets the ‘formEditContact’ form control with selected item from Gallery on ‘EditContact’ screen.
    • Navigate(EditContact,ScreenTransition.Fade) – Navigates to ‘EditContact’ screen.

Test the Application:

  • Run the ‘Application’ and click on ‘Edit’ icon.

PA_Edt5

  • In the next screen, change the data and click on Save icon.

PA_Edt6

  • You should see the modified values in the ‘galContacts’ Gallery.

PA_Edt7

In the next article, we will see how to render ‘Option Sets’ and ‘Look up’ controls.

🙂

Categories: CRM

[Dynamics On-Premise] Mailbox Error – Server does not support secure connections

November 12, 2019 Leave a comment

Other day while configuring ‘Mailbox’, we got ‘Server does not support secure connections‘ exception, while approving the Mailbox using ‘Approve Email’ button.

EmailBoax_1

Reason:

Fix:

EmailBoax_3

  • We can set the ‘Use SSL for Incoming/Outgoing Connection’ properties either by making an SDK call or by updating ‘EmailServerProfileBase’ table in DB.

EmailBoax_2

🙂

[Step by step] Basic Canvas app using Dynamics 365 as Data Source

November 8, 2019 1 comment

In this article, I am going to provide steps to build a basic Canvas app which uses Dynamics 365 (CDS) as Data Source.

If you are new to Power Apps, refer my blog on steps to get started.

The App we are going to build will have 3 screens.

  • Manage Contacts – Displays the list of Contacts using ‘Gallery’ control.
  • Create Contact – Creates a new Contact.
  • Edit Contact – Updates an existing Contact.

Create a new Canvas app:

  • Connect to the Power Apps portal and select the ‘Environment’.
  • Create a new ‘Canvas app from blank’.

PA_Env3

Connect to Dynamics 365 data source:

Now we have the blank App and as a first step, create a new data source by connecting to your D365 instance using ‘Dynamics 365’ connector.

  • Click on the ‘Data source’ tab.
  • Under the ‘Connectors’, select ‘Dynamics 365’ and choose the ‘dataset’.
    • ‘dataset’ is your Dynamics organization name.

PA_Env4

  • Next, under the ‘Choose a table’ pane, select the entities you would like to work with.
    • I’ve chosen ‘Contacts’ entity for this App

PA_Env5

  • Click on ‘Connect’
  • You should see the ‘Contacts’ table under ‘Data sources’ as below:

PA_Env20

Design ‘Manage Contacts’ screen:

Now we have ‘Data source’ ready and lets design our first screen.

  • By default the Canvas app will have a screen.
  • Rename the out of the box screen to ‘ManageContacts’
    • Providing appropriate name to the controls is a best practice.
  • As we need to display available ‘Contacts’ on the screen, select ‘Insert -> Gallery’ and choose ‘Blank Vertical’.
    • ‘Gallery’ is a grid kind of a control.

PA_Env6

  • Now we need to map ‘Contacts’ table to the Gallery.
  • Select the ‘Gallery’ and click on ‘Edit gallery’ icon.

PA_Env7

  • In the ‘Select a data source’ pane, select ‘Contacts’ table. Now the ‘Gallery’ gets mapped with ‘Contacts’ from Dynamics.

PA_Env8

  • To display the Contact details (i.e., Full Name, Email, etc…), add ‘Label’ controls to the ‘Gallery’ and rename the Labels with meaningful names.
  • Labels will not show anything until you map them with the Contacts field.
  • So, select the Label and in the ‘Text’ property, type ‘ThisItem.{field_Name}
    • To map, ‘Full Name’ of the Contact to a label, set ‘Text’ as ThisItem.’Full Name’

PA_Env9

Design ‘New Contact’ screen:

In the ‘Manage Contacts’ screen, we configured a ‘Gallery’ which displays all the Contacts. Now lets design a ‘New Contact’ screen.

  • Add a ‘New Screen’ and rename it.
  • To Create/Edit records, we need to add ‘Forms’ control
    • ‘Edit’ form: Use this to Create or Edit a record.
    • ‘Display’ form: Use this to display the record (Read-only).
  • So, lets add a new ‘Edit’ form to the screen and rename it to ‘formCreateContact‘.

PA_Env12

  • Next, we need to map the ‘formCreateContact’ to ‘Contacts’ Data source and then select and arrange the ‘Contact’ fields, which allows us to input and save.
    • Set the ‘DataSource’ property of ‘formCreateContact’ to ‘Contacts’
    • Click on the highlighted link and add the required columns and click ‘Add’.

PA_Env13

  • Next, we can rearrange the columns using ‘Move up’ and ‘Move down’ options.

PA_Env14

  • We can also set ‘Columns’ to 1 of the ‘formCreateContact‘ which arranges the fields in a single column.
  • Add ‘Save’ icon to the ‘CreateContact’ screen.

PA_Env16.PNG

  • As we need to save the ‘Contact’ (i.e., Submit the Form) on ‘Save’ icon click, add below statement

SubmitForm(formCreateContact);

Link ‘Manage Contacts’ screen and ‘New Contact’ screen:

Now, we have the ‘New Contact’ screen ready. Lets hook it up to ‘ManageContacts’ screen.

  • Go to ‘ManageContacts’ screen and add + icon.
  • There are 2 key steps to create a new Contact
    • First create a new form of type ‘formCreateContact’.
    • Navigate to ‘New Contact’ screen.
  • We need to execute these key steps on click of + icon.
  • Select the + icon and on the ‘OnSelect’ event, add below statement

    NewForm(formCreateContact);Navigate(CreateContact);

PA_Env15.PNG

  • That’s it, run the App and you should be able to see the Contacts on ‘Manage Contact’ screen.

PA_Preview1.PNG

  • Click on + icon, which will take you to ‘New Contact’ screen.

PA_Preview2

  • Lets see ‘Edit Screen’ and Navigation’s in next article.

🙂

 

Categories: CRM, PowerApps Tags: ,

ADX Portals – Cannot register for ‘OnSendingHeaders’ event

November 5, 2019 Leave a comment

Other day, while configuring portal on a new CRM instance, portal shown error page, up on clicking the ‘Apply’ button.

License_Error1

There were no details on error screen to deduce the reason. So we had to go to the server where our portal website hosted.

When checked the ‘Event Viewer’ logs in Portal server, there was this following exception:

Exception type: InvalidOperationException

Exception message: Cannot register for ‘OnSendingHeaders’ event after response headers have been sent.

Reason & Fix:

  • CRM instance was missing ‘Adxstudio License Key’ record.
  • Post CRM connection, ADX would first check for the valid ‘License Key’. Since there was no ‘License Key’ record, Portal thrown error.
  • To fix this, add the ‘License Key’ by going to ‘Advanced Find -> ADXStudio License Keys‘, add a key.

License_Error2

🙂