How to Use Filter Criteria for Dynamics 365 Portal Actions

by | Updated April 12, 2019 | Dynamics CRM

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 [your portal URL]/_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


Submit a Comment

Your email address will not be published. Required fields are marked *

Upcoming Events


02jun2:00 pm2:30 pmBusiness Intelligence for Batch Manufacturers

16jun10:00 am10:30 amHow AP automation can speed up month-end close in D365 Finance

17jun11:00 am12:00 pmConfab Live with Stoneridge – Real Time Marketing Strategies for Success

23jun10:00 am10:30 amThe Modern Manufacturer: Cost Accounting in D365

30jun10:00 am10:30 amAP Automation Checklist for a 2022 Rebound

30jun2:00 pm2:30 pmAchieving Success: How Technology Is Helping Nonprofits Thrive


01jul11:00 am12:00 pmConfab Live with Stoneridge – Dataverse Virtual Entities

14jul12:00 pm12:30 pmBeyond Reporting - What Business Intelligence Can Do For Your Agribusiness

15jul11:00 am12:00 pmConfab Live with Stoneridge – Integration Strategies for End User Success

21jul10:00 am10:30 amThe Modern Manufacturer: Manufacturing Software in the Real World

21jul12:00 pm1:00 pmIs it Worth it to Upgrade to Dynamics 365 Finance and Supply Chain Management? - Everything AX Users Need to Consider

About Stoneridge
Stoneridge Software is a unique Microsoft Gold Partner, with emphasis on partner. With specialties in Microsoft Dynamics 365, Microsoft Dynamics AX, Microsoft Dynamics NAV, Microsoft Dynamics GP and Microsoft Dynamics CRM, we focus on attracting the most knowledgeable experts in the field to our team, and prioritize delivering stellar solutions with maximum impact for your business. At Stoneridge, we are deeply committed to your results. Each engagement is met with a dedicated team, ready to provide thorough, tailored, and expert service. Based in Minnesota, we intentionally “step into your shoes,” wherever you are. We focus on what you care about, and develop trusting, long-term relationships with our clients.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!