Prevent Save with openConfirmDialog 


Prevent Save with openConfirmDialog – executionContext.getEventArgs().preventDefault() and Xrm.Navigation.openConfirmDialog

https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/288587/openconfirmdialog-not-preventing-save

save

Kailash Ramachandran's avatarMy Trial

There are times we might need to have a confirmation dialog before saving the record and in the case of cancel, needs to refresh the form data to previous state. Confirmation dialog is achievable using the client side SDK scripts. It is pretty easy to put the confirmation dialog in the save event, the tricky part is how to prevent saving and resetting the old data when confirm dialog is cancelled.

The below code help to make use of the save event functions to better use and achieve the need.

function onSave(executionContext) { var depth = sessionStorage.getItem("depth"); if(depth == null || depth == "0"){ console.log("Depth - "+ depth); sessionStorage.setItem("depth", "0"); var formContext = executionContext.getFormContext(); executionContext.getEventArgs().preventDefault(); var tagMetaData = []; const tagNames = []; var xml = formContext.data.entity.getDataXml(); var node = (new DOMParser()).parseFromString(xml, "text/xml").documentElement; var nodes = node.querySelectorAll("*"); if(nodes.length > 0){ for(let i = 0; i < nodes.length; i++) { if(nodes[i].getAttribute("type")…

View original post 133 more words

How to – Configure Azure Event Grid System Topic and Subscription to enable Call recording and SMS in Dynamics 365 Omnichannel Voice


Azure Communication Services uses Azure Event Grid to send real-time event notifications for chat, telephony, video, SMS, and voice calling events.

Azure Event Grid will then route the event messages to the subscribers, one of them being the Azure Application we registered while configuring the Voice channel.

https://nishantrana.me/2022/10/17/how-to-set-up-omnichannel-voice-using-azure-communication-service-acs/

We had specified the Azure App id and tenant id while connecting to ACS from Dynamics 365 as the Event grid app id and Event grid app tenant id.

  • So first we need to register Azure Event Grid System Topic for our app to listen to Azure Communication Service Events.
  • Next, we need to subscribe to specific events for call recording, sms, etc by creating Azure Event Grid Subscriptions.

Login to Azure Portal, create a new Event Grid System
Topic as shown below

Specify Azure Communication Services as Topic Types and for Resource select the Azure Communication Service resource created earlier.

Create the Event System Grid Topic.

Navigate to the topic created, and next create an Event Subscription there.

Provide the below details

File to Event Types = Recording File Status Updated

The other event types available are –

For the webhook’s endpoint, navigate back to the Omnichannel Admin Center,

From the Phone Number >> Advanced Settings copy the WebHook Endpoint URL.

Paste it there and navigate to the Additional features tab.

Check AAD Authentication and specify Tenant ID and AAD Application ID or URI, the same details that were specified while connecting ACS from Dynamics 365 as event grid app id and event grid app tenant id.

additionaltab

Click on Create and we are now done with the required setup.

We got the below error while creating the Azure Event Subscription https://nishantrana.me/2022/12/15/fixed-deployment-has-failed-with-the-following-error-codewebhookaadappaccesscheckcategorymessageaccess-check-failed-for-webhook-aad-app-with-error-subscribers-client-user/

Back inside Dynamics 365 Customer Service Workspace, we can see both the inbound and the outbound call getting recorded.

Thanks to this wonderful post that helped us in configuring it – https://triciasinclair.com/2022/04/25/setting-up-omnichannel-voice-using-azure-communication-service/

Also, check – https://learn.microsoft.com/en-us/dynamics365/customer-service/voice-channel-connect-existing-resource?tabs=customerserviceadmincenter#enable-call-recording-and-sms-services

https://triciasinclair.com/2021/01/27/d365-customer-service-voice-channel/

https://neilparkhurst.com/2022/08/11/omnichannel-for-customer-service-collection-2/

Hope it helps..

Advertisements

Fixed – Value must be a data entity record error in Power Apps


We got the below error while trying to use the Relate function – “Value must be a data entity record”

 

 

 

 

 

As the error message clearly states and also if we see the syntax, the Relate function expects a record

Below was our formula for OnSelect, which was throwing the error

Here instead of passing the record, we were passing the table in the Relationship which was the reason for the error.

We changed it to store the ThisItem

And also updated the OnSelect

This fixed the issue for us.

Hope this helps..

Advertisements

Fixed – Custom Page not opening or Page doesn’t exist in this app error in the model-driven app (PowerApps)


Recently we created a custom page to be opened from the Ribbon / Command bar, however, the page was not opening for us, even though the function was running properly.

https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples

Here we had created the custom page from within the solution area, so we need to add this custom page to our model-driven app. (The other option is to create the page from the Modern App Designer.)

https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/add-page-to-model-app#create-or-edit-a-custom-page

Open the app in the Modern App Designer and click on Add Page

Select Use an exiting custom page, select the page and uncheck the Show in navigation option as we are opening this page from the form.

Publish the app.

This time clicking on Open Custom page command/button on the form successfully opened the custom page for us.

Thanks to Andrew (https://butenko.pro/) for the solution.

Hope it helps..

 

Advertisements

PowerApp CDS – Multi Select Items in Gallery using Checkbox – Bulk Activate and Deactivate records – Use of Patch vs ForAll


Sachin Bansal's avatarBansal Blogs - Dynamics 365, PowerApps, Microsoft Flows, Power BI

BU1

In my previous blog, I explained how to filter active and inactive records based on value selected in drop down. In this blog we will see how we can select multiple items in Gallery and activate or deactivate bulk records. We will cover below as part of this blog:

  • Add Checkbox control to Gallery list
  • Create a collection and add selected item in collection when checkbox is checked
  • Remove item from collection when checkbox is unchecked
  • Add a button to activate or deactivate selected records
  • Difference between Patch and ForAll functions

I have a simple CDS app which filters active or inactive companies based on value selected in drop down and display them in Gallery list. Let’s add checkbox control in Gallery.

Add Checkbox to Gallery:

  • To add checkbox inside gallery, select first row in Gallery and click on Check Box option in Controls menu under Insert tab

BU2

  • Align…

View original post 553 more words

How-To #6: Display Multi-Select Choices in Power Apps Label


Fausto Capellan Jr's avatarFausto Capellan, Jr

I was recently working on an app to display items from a SharePoint list in a gallery. This list, let’s call it Teachers, has 2 columns: Title and Grade. The Title column is a Single line of text column and the Grade column is a Choice column that allows multiple selections. Displaying the records in a gallery is usually straightforward: you set the Textproperty of each label to the respective column using the following value: ThisItem.ColumnName. This is very easy for my Title column because it is set as follows: ThisItem.Title. You can say, “But wouldn’t you use the same approach for the Grade column?”, but because Choice columns are complex, the approach is different. Let’s walk through that:

You would think that to set the Text property of the label for Grade you can set is as follows: ThisItem.Grade.Value. This does not work…

View original post 254 more words