Portal web-roles drive what a portal user (contact) can see and do. If you only need a straightforward set-it-and-forget-it rule—no complex branching or API calls—a classic background workflow is still the quickest tool in the box.
1 Prerequisites
Requirement | Why it matters |
---|---|
System Administrator or System Customizer security role | You need permission to create workflows and update contact/adx_webrole records. |
Portal solutions installed | The workflow actions Assign Web Role / Unassign Web Role are part of Microsoft’s portal managed solution. |
2 Create the Workflow Shell
-
Settings → Processes → New
-
Enter a name, set Category = Workflow, and choose Entity = Contact.
-
Tick Run this workflow in the background (recommended) unless you truly need real-time behaviour.
-
Under Options for Automatic Processes, tick the event(s) that will kick things off (e.g., Record is created).
3 Add the Assign Web Role Step
-
Click Add Step ► MicrosoftDynamics…Portals ► Assign Web Role.
-
In the step’s properties pane, click Set Properties.
-
Contact: should auto-populate with Contact (Workflow).
-
Web Role: look up and select the portal role you want (e.g., Authenticated Users, Case Manager).
-
Optionally, add a descriptive Name for the step, like “Grant Members role”.
4 (When Needed) Add Conditions
If you only want to assign the role when certain criteria are met:
-
Insert a Check Condition step above your Assign Web Role action.
-
Build the logical expression (e.g., Status Equals Approved).
-
Nest the Assign Web Role step inside the If branch.
5 Un-assigning a Role Instead
The reverse is identical:
-
Add Unassign Web Role from the same portals menu.
-
Pick the Same Web Role you previously granted (the workflow engine needs to know which one to remove).
-
Place it under its own condition or under the same branch, depending on your business logic.
6 Save, Activate, Test
-
Save & Close the designer.
-
Click Activate in the toolbar.
-
Create or update a contact that meets your trigger and confirm the role is added/removed under Contact → Portal Contact sub-grid Web Role Assignments.
Quick Tips & Troubleshooting
-
Multiple Roles? A contact can hold several roles; the workflow only touches the specific role you pick.
-
Idempotency: Running an Assign Web Role step twice on the same contact/role pair is harmless—the second run is ignored.
-
Audit Trails: Enable audit on Contact and Web Role assignment entities to verify who/what assigned a role.
-
Background vs. Real-time: Real-time workflows run before the form closes, useful when role assignment must be immediate for subsequent plug-ins; otherwise stick with background for performance.
-
Moving to Power Automate: For cross-tenant or non-Dataverse triggers, consider a cloud flow instead. Use the Add a new row action targeting the
adx_webrole_contact
intersect table (Web Role ↔ Contact).
No comments:
Post a Comment