How to Use Filter Criteria for Dynamics 365 Portal Actions

By Adam Hallbeck | April 11, 2019

How to use filter criteria for dynamics 365 portal actions

If you’ve been working with Dynamics Portals for any amount of time, you’re probably well aware that there are myriad of ways to design, configure, and customize how your portal users interact with data. Considering what you’re exposing to portal users, how your entity permissions are established, the general flow of creating and editing records, and so many other things to manage, granular details like how or when users should interact with data might slip by.

Maybe you’ve found yourself in this kind of exchange with customers or stakeholders in the past:

  • Sales Manager: “Hey! We’re seeing some weird Orders come into the system…it seems like people on the portal are messing with some of the Order Products.”
  • Dynamics 365 Owner: “Hmm…well, I know we have it set up so they can delete those lines. Do the portal users need to be able to delete Order Products at all?”
  • Sales Manager: “We shouldn’t be allowing that if the Order is in a Submitted status. Is there a way to set that up?”

Luckily for us, there is a way to restrict those actions! Here’s how to use filter criteria for Dynamics 365 Portal Actions.

When you’re configuring a list or subgrid actions (things such as create, download, details, edit, delete, etc.), navigate to your View or Item Actions on the record. By default, ‘Advanced Settings’ is not checked. Check Advanced Settings to open up more action options:

Dynamics Portals

Once you have Advanced Settings opened up, you’ll notice a ‘Filter Criteria’ area within each action. This is what allows us to control how and to whom these actions appear. In simple terms, we’re telling the system to only allow this action under certain circumstances, and we define those circumstances using a FetchXML query.

If you’ve been working in Dynamics 365 CE and aren’t familiar with how to write FetchXML queries directly, no worries! You’ve probably been building them in the system for quite a while and don’t even know it. Whenever we use Advanced Find in Dynamics 365 CE, we’re building searches, creating views, and analyzing data- all of which is done through the Advanced Find UI (which desperately needs an update), but built on FetchXML behind the scenes.

To use that background FetchXML for controlling our portal actions, first, build your query. In this example, our hypothetical portal pros above want to restrict delete actions, and only open that up if the parent Order is in a certain Status/Status Reason. We want to filter this action down to only be available when the parent Order is in an ‘Unsubmitted’ Status Reason. In Advanced Find, search for Order Products where the related Order is in that Unsubmitted Status Reason. It should look something like this:

Dynamics Portal

Once the query is set properly, click the ‘Download FetchXML’ to snag the XML we’ll us in the portal action Filter Criteria:

Dynamics Porta

Save the file locally and open it up with your preferred app (mine is Notepad++):

Dynamics Portal

See those ‘attribute name=’ lines in there? Those are the view columns you have set up in whichever view was set in Advanced Find when you pulled down the FetchXML. Those, as well as the line that contains the Advanced Find view sorting (here, it’s the line with “productid” descending=”false”), can be removed from the query since they aren’t relevant to portal actions. Here’s our cleaned up, final version:

Once we save the Entity List/Metadata record where your action is located, it’s a good idea to clear your portal cache before going to scope out the new functionality. You can access your portal cache and search index rebuild options by navigating to /_services/about (it’s a good idea to bookmark that full URL):

Dynamics Portal

Once the cache is cleared, we can now access our portal Order form and test it out. This is a screen of Order Product actions in an Unsubmitted Status Reason:

Dynamics Portal

And this is a screen of Order Product actions in Submitted Status Reason:

Dynamics Portal

And there you have it. Leveraging the portal action feature in Dynamics 365 CRM is an awesome way to provide certain actions and features to portal users only under certain circumstances or at certain points.

If you have any more questions about using Portals in Dynamics CRM, feel free to reach out to the team at Stoneridge Software.

Related Posts

Recommended Reading:

5.27.22 Dynamics GP

How to Run Drop Ship Sales in Dynamics GP

Need to Invoice the Customer before you get the invoice from the vendor? This The freight forwarder has contacted you […]

Read the Article

New Features in Dynamics 365 Business Central 2022 Wave 1 Release – Protecting G/L Accounts From Being Deleted

There are a lot of exciting New Features in Dynamics 365 Business Central 2022 Wave 1 Release to get excited […]

Read the Article
5.25.22 Financials

Rounding Numbers in Power Automate

  If you’ve ever tried to round numbers in Power Automate, you have probably already run into the issue there […]

Read the Article

Manage U.S. Use Tax on Purchase Orders in Dynamics 365 Finance and Operations

  Managing sales tax requirements on your business purchase can be complicated, but Dynamics 365 Finance and Operations can help […]

Read the Article
5.19.22 Dynamics CRM

How to Write a Great Support Ticket in the Stoneridge Support Portal

Submitting a support ticket through the Stoneridge Support Portal is a quick and effective way to get assistance for any […]

Read the Article

Managing Your Business Through Uncertain Times Using Dynamics 365 Finance and Operations

  Dynamics 365 Finance and Operations (F&O) can help you make informed decisions on how to move your business forward. […]

Read the Article
5.13.22 Power Platform

Using Power BI Object Level Security

  The following article will demonstrate how to use Power BI Object Level Security to disable column data based on […]

Read the Article
5.12.22 Dynamics CRM

How to Use the Stoneridge Support Portal

Stoneridge Software’s support portal is an intuitive and useful function that makes it easy for you to access resources to […]

Read the Article
5.6.22 Dynamics GP

Dynamics GP Transaction Removal: Purchase Orders

  Are you having performance issues with Purchase Orders?  Do you find that there are old Purchase Orders on your […]

Read the Article

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X