Coder Social home page Coder Social logo

officedev / project-dataverse-plugin-sample Goto Github PK

View Code? Open in Web Editor NEW
6.0 8.0 3.0 18 KB

Sample of a Dataverse plugin used with Project Power Apps and Project for the Web plugin to block users from deleting projects.

License: MIT License

C# 100.00%

project-dataverse-plugin-sample's Introduction

Dataverse Plugin to Block Project Deletion

In Project for the Web, any user that has a project shared with them can delete the entire project, without being able to revert the deletion if this was done by accident. Teammates can also delete shared projects without having a project license when using Project Power Apps.

To limit this from happening, you can use Dataverse plug-ins to disable the delete operation on projects for a user based on any Dataverse condition that you determine. In the plug-in in this example, we will be removing the delete permission from a user that is not in a specific Team in Dataverse. Dataverse Teams can be backed by a M365 Group or created manually.

Scenario

As a Dataverse Admin, I want to limit who has permissions to delete projects in Project Power Apps and Project for the Web.

Prerequisites

To use this code sample, you need the Official Dataverse plug-in pre-requisites, which you can find here.

How to use this solution

Please visit the Official documentation to Write a Dataverse Plug-in for latest updates. A step-by step to use this sample plug-in is provided below for convenience.

IMPORTANT: In the ProjectBlockDeletePlugin.cs file where commented TODO, you need to manually enter the Team Id give delete privileges to. You can find these in Power Apps Data Explorer.

  1. Sign the Assembly:
    • Right click the project in your Solution Explorer and press Properties.
    • Go to the Signing tab, check Sign the assembly, Choose <New…> from the dropdown options and name your signature. Password is optional.
  2. Build your solution by right clicking the project in your Solution Explorer and pressing Build.
  3. Launch the Plugin Registration Tool (installed in Prerequisites).
  4. Press the Create New Connection button at the top left and enter the account from which you want to register the plugin to Dataverse.
  5. Register a new assembly.
  6. Load the assembly from the .dll previously built, which is stored in your project’s Debug folder.
  7. Press Register Selected Plugins.
  8. Find your Plugin Assembly in the list of Registered Plugins and right click to Register a new Step.
  9. Register the step with the following changes:
    • Message: Delete
    • Primary Entity: msdyn_project
    • Event Pipeline Stage of Execution: PreValidation
  10. We’re done! You can now test manually in Project Power Apps and Project for the Web to verify functionality.

Additional resources

Copyright

Copyright (c) 2016 Microsoft. All rights reserved.

project-dataverse-plugin-sample's People

Contributors

microsoftopensource avatar kamymouss avatar microsoft-github-operations[bot] avatar

Stargazers

Sudh avatar  avatar Marko Zajc avatar Oghenekevwe Sarah Adasaji avatar  avatar Josh Booker avatar

Watchers

Yina Arenas avatar James Cloos avatar Kelbow-MSFT avatar Vesa Juvonen avatar David Chesnut avatar Nadin Merali avatar Chris Boyd avatar  avatar

project-dataverse-plugin-sample's Issues

Plugin sends error code: 0x80040265

Hi,
I have successfully followed the instructions to setup the plugin in our Dataverse environment.
The plugin is called when deleting, BUT bings following error message:
Business Process Error
An error occurred in ProjectBlockDeletePlugin.
Error code: 0x80040265
Session Id: 9058a0f7-4994-4e20-b475-80d197099a15
Activity Id: e0d9b7d0-3137-4f9c-bec0-6905a8449a6f
Time: Tue Mar 08 2022 16:56:12 GMT+0100 (Central European Standard Time)
The only thing I changed in the source is the Object-ID of the MS365-Group and the message.
Let me know what else do you need to support me to fix this error.
Thanks for your support
Dieter
[email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.