How to – Filter Collection / Items in Gallery based on the related (Lookup) record’s value – Power Apps / Canvas Apps (Dataverse/Dynamics 365)


Suppose we have 3 tables, Table A, Table B, and Table C related to each other as

Table A (n-1) Table B (n-1) Table C i.e.

Table A has a lookup of Table B and Table B has a lookup of Table C.

Below is our sample canvas app that has a gallery and a combo box.

What we would want is based on the Table C record’s name selected in the combo box, we want to filter the collection to only show those records that are related to it.

One of the ways we could implement this is by using the AddColumns to add Table C data to Table A and apply the Filter to it.

Below is the formula to achieve the same.

In Table A, add a column name “TableCName”.

To get the Table C name, perform a Lookup on Table B, where Table B GUID is equal to Table A’s Table B lookup field, and then fetch the Table C Lookup’s name from Table B.

And lastly, perform a Filter on this new column TableCName, based on the selected value in the combo box.

See it working –

https://www.screencast.com/t/XZNDEsykAw

On selecting Table C1 in the combo box –

Similarly on selecting Table C2 in the combo box

Thanks to Debajit for guiding – https://debajmecrm.com/how-to-use-addcolumns-with-lookup-fields-of-sharepoint-in-power-apps/

To read more on AddColumns, Filter, and Lookup.

Hope it helps..

Advertisements

Product Table has Village Lookup in it and Village table has Region lookup in this sample screenshot

InvalidPluginExecutionException error dialog not showing up – Dynamis 365 / Dataverse


One of the reasons why throwing the InvalidPluginExecutionException doesn’t show up error dialog could be that you would have Profiled that step with profile storage as Persist to Entity.


Stop Profiling and it should work as expected.

error

Check for more details on InvalidPluginExecutionException

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/handle-exceptions#cancelling-the-current-operation

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/best-practices/business-logic/use-invalidpluginexecutionexception-plugin-workflow-activities

Hope it helps..

Advertisements

Fixed –Web resource method does not exist in Dynamics 365 / Dataverse


We might get this error while working with Web resource of type JavaScript.

Either it could be because the method doesn’t exist or it could be because of the incorrect syntax.

For a small file, it is easy to figure out, but for a large file, we could use online validator tools like

Fix the syntax error, upload and publish the file and the error should get fixed.

Hope it helps..

Advertisements

Fixed – Bad Request – Error in query syntax while using Xrm.WebAPI


We might get the below error while using Xrm.WebAPI.

‘Bad Request – Error in query syntax.’

One of the reasons could be that while setting up the Lookup field, we haven’t removed the curly brackets.

Use the below function to replace/remove them.

  • let result = myGuid.replace(/[{}]/g, ”);
  • let result = myGuid.replace(“{“, “”).replace(“}”, “”);

Hope it helps..

Advertisements

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