D365 PSA: Restrict Project access only to their Project Managers

Out-of-the-box PSA’s Project Manager security role provides complete access to even other Project Managers. But then, what if you want to bring down the access of the Project Managers to their own Projects only?

Remember, access in D365 PSA is provided for Owner (ownerid) field and not Project Manager (msdyn_projectmanager) field.

PSARoleRestrict

Scenario

Now, I don’t want a Project Manager to have access to others Projects and looks like this can’t be controlled from the Security Level perspective, given the Project Manager is a separate field than Owner of the Project.

So, I’ll limit the access to only the User level (the one who created the record would have the access, obviously)

PSARoleRestrict2

But this remove the access from even the Project Managers since they don’t own the Projects. To overcome this, I’ve written a simple plugin to provide access to the Project Manager whenever they are updated by Sharing and giving PMs the access.

For this, I’ve written a plugin code that will grant all permissions to the Project Manager of that Project and I would like to share this with you all to consume it.

GitHub Project

Here’s the GitHub repository I’ve created which has the plugin code and the Unmanaged Solution that contains only the plugin assembly and the registered step –

Link: D365PSA-PMAccessRights

gitProj

The D365 Unmanaged Solution resides here –

unmanagedSoln

This will work in the following scenarios –

  1. When a Project Manager is changed from Person A to Person B, the access rights of Person A will be removed and granted to Person B.
  2. You can even create a trigger field and use an on-demand workflow to set the trigger. This trigger should be included in the filtering attributes of the plugin step to update the existing records.

This will provide access to the Project Manager of the Project automatically apart from the Owner so that they see/access only Projects that concern them
accessGiven

Make sure no other security role is overriding your restricted access.

Hope this helps! 🙂

Advertisements

D365 Quick Tip: Simple & Detailed Mode in Advanced Find

If you ever wanted to refine your Personal Settings and ever came across this setting that asks your to set the default mode in Advanced Find
setting

But didn’t observe the Advanced Find well? Here’s what it does

Simple Mode

As per Advanced Find behavior, the view which you are on is pre-selected in the Advanced Find.

And observe that the query is locked and you actually need to click on Details to expand it or make it editable
simpleMode

And then it expands like this
expanded

Detailed Mode

In Detailed mode, if you click on Advanced Find button, the query will already be in detailed view ready for you to be edited directly without you needed to click on Details as in Simple mode
advancedMode

 

Hope this quick tip saves you that extra bit of second. 🙂

Get SharePoint Document Location link on field on create in D365

I’ve been working on getting the SharePoint Document’s link to get back into D365 but looks like it can’t come back and get tagged to the record it was created from.

I tried to fire off a plugin on SharePoint Document record create, but in vain. Flow didn’t do justice since SharePoint Document entity doesn’t support Change Tracking.

So, I retrieved the Absolute URL of the “SharePoint Document Location” entity on it’s create itself so that I have the link once the record is created. And click that link to open the folder in SharePoint.

Workflow to wait and then fetch

So if you immediately make a call to retrieve the Absolute URL in the plugin code you’ve written on Create won’t work because Absolute URL gets created moments after the actual Location record is created unlike being passed in the execution context.

My approach is to fire the workflow on the create of the SharePoint Document Location record and Wait for 1 minute.

wfBody

After 1 minute, set off the flag to call the plugin and fetch the Absolute URL as shown below –

updateFlag

Retrieve Absolute URL in Plugin

You can use RetrieveAbsoluteAndSiteCollectionUrlRequest message to retrieve the SiteCollection URL and the Absolute URL of the document folder of the record

retrieveAbsolute

 

Working

  1. When you open the Document sub-grid on the record for the first time, a Document Location record is created –
    openForFirst
  2. The workflow designed above will run and fire off the plugin after 1 minute. The plugin will then make the message request go through to get you the Absolute URL as below –
    link2
  3. And probably you can use that link to open up the folder by clicking on the field that has this URL or send it across in email to internal users (whatever suits your requirements)
    linkInField
  4. It will open up the SP folder for that record and will have all the documents you attach in the Document sub-grid on the record.
    spFolder

Hope this helps!

D365 Quick Tip: Bulk Clear field values

A very handy approach for admins and users of Dynamics 365 who want to bulk clean up field values – And just selecting them in Bulk Editing them as shown below doesn’t help!!

So here’s the scenario – You want to clear the selected records for their Credit Score field
containsData

Because primarily, you can commonly put a value in a field using Bulk Edit, but not clear the value.

 

Workaround

What you can do instead, create a quick and simple workflow to clear the field.

  1. Create an On-Demand workflow on Contact entity with an Update step for Contact
    workflowBody
  2. In the Update step, point to the field and then select the Operator on the right hand side to select Clear
    operator
  3. Make sure the Clear appears on the field you want to Bulk Update
    clearField
  4. Once done, save and Activate the workflow. Run on the selected records you want to clear at once
    runWorkflow
  5. The values will now be cleared for these records
    cleared

Hope this helps!

D365 Quick Tip: Shortcut to Settings from the Unified Interface

If you’re spending time looking and wondering that you always need to go to the app switcher to go the Settings from the Unified Interface, you need to do the following –

Once you are in the Unified Interface, click on the Gear icon next to the help icon on top-right corner as shown below and click Advanced Settings

advancedsettings

 

Right on the next tab, Settings with the classic UI is shown –
fullsettings

And there’s nothing else on that SiteMap.

 

And that’s it! 🙂

 

D365 Quick Tip: Why BPF wouldn’t appear in D365 Unified Interface?

Got stuck trying to figure out why the Business Process Flow you created/modified couldn’t be seen in the Unified Interface?

Like I have this BPF called ‘Onboarding Process’

actualprocess

But when I look at the form on the Sales Hub, it won’t show up
blankrec

 

And when I Switch Process and try to apply, it won’t apply either
applying

Where could we check to make sure it appears –

  1. Whether it was Activated.
  2. Whether it was corrected ordered in the Order Process Flow
  3. Logged in user had correct privileges to access it.
  4. Even trying to switch to the process won’t make it appear!

and so on.

But there’s one thing that needs attention when

App Designer is the answer

The reason is the App Designer for the Unified Interface app you are in.

  1. In this case, the Sales Hub app.
    Open the Sales Hub app and look for Business Process Flows section and expand it.
    missingprocess
  2. On the right hand pane, find your BPF and add it in the App Designer
    foundprocess
  3. Once you added, it should appear in the included BPFs. Save and Publish once confirmed
    added

BPF is now applied

Now, your BPF is finally added and you can work on it.
appeared

Hope this helped! 🙂

Failed to Generate Excel error when trying to Export Data from Advanced Find

Here is the most common issues seen while trying to Export data to Excel from an Advanced Find view. And you end up seeing this error which says ‘Failed to Generate Excel’ –

error

Getting the Error

  1. So this is what you typically do – When you run an Advanced Find and click on Export when you see the results
    exportofaccounts
  2. Or, when you are in an entity’s view and you want to Export to Excel right from the ribbon button like this –
    exportfromview
  3. But, as soon as the File is being generated and you feel you’re there –
    generating
  4. You see this –
    error

 

Culprit

The reason for this is – Redundant Display Names of the fields used in the View you are exporting
duplicatedisplaynames

How to catch this

The easiest way to catch this is trying to Export the view to Excel Online, this will give you the exact error
exacterror
The Downloaded Log File won’t help much in identifying the column that is duplicate though, you’ll need to go through the Columns manually to check

 

Hope this helps! 🙂