- Remove all accounts that are inactive:
- An account is inactive when all these conditions are met:
- There aren't any related cases with status "open"
- The latest case closed is dated 3 years ago or more
- An account is inactive when all these conditions are met:
- Add new field 'Legacy hold' , type boolean Only View/Edit by user with security role “CEO-Business Manager”.
- Add new field 'Legacy Hold Details' Only View/Edit by user with security role “CEO-Business Manager”.
- When Selecting 'Yes' on 'Legacy hold' :
- Warning Message appears, asking to confirm the action and requesting to fill in the details
- When the system deletes the inactive accounts, all the related entities are deleted as well
Building the solution with MS Visual Studio
The solution contains two projects :
- tfl.test: is a project for testing of the application.
- tlf.labtest: is a Custom CodeActivity to create the bulkdeletion job.
Open the file tlf.labtest.sln inside the root folder of the project.
Search for the file named app.config, open it and replace the ConnectionString string with the value ClientID, ClientSecretm, from Azure AD.
More details how to configure the AD [here](https://raw.githubusercontent.com/philippe78/tlf.labtest/master/CRMSolution/pictures/ad.pdf ("here")
- Download from the file lab_1_0_managed.zip, located under the folder 'CRM Solution'
- Open the advance setting menu item from the new CRM Instance ( We are using for the instruction the classic view, but is also available other option as the Power Platform )
- Select the menu item 'Solution' under the group 'Customisation' .
- Follow the wizard steps to import the file
- At the end of the import, select the solution, open it, and click on the item configuration
- Click the button Create bulk delete Job
The tests are based on the 'Customer Service HUB Application' select it when the first login is prompted as shown on the image below :
CRM Dynamics CE, has different modules built with different architecture, for each one the testing needs to follow a different approach. I have delivered with this solution two groups of tests that cover the requirements.
- Based on Visual studio UNIT Test, which are automated but cover only the programming side
- Acceptance test based on manual operations
With more time availble, the acceptance test can be done also using some third party tools as Katalon
Only for the atomated tests, is required to create an active directory user on Azure and link it to the CRM as an application user, since it requires the Client ID and Cient Secret. More details here
Description :
Login with a user without the role “CEO-Business Manager”.
Result : The form should not contain any field for Legacy hold, under the section GDPR
Description :
Login with a user with the role “CEO-Business Manager”.
Result : The form should contain Legacy hold, and Legacy Hold details under the section GDPR
Description :
"CEO-Business Manager”, select "yes" in the field 'legacy hold', and then try to save without filling in the 'legacy hold details field'
Result : The form should first display a warning message and setup mandatory the field legacy hold.
When trying to save, displayes another warning message, preventing the operation.
Description:
- Create a new account
- Create a new case and fill the customer section with the new account just created
- Add a new task
- Delete the account
Result : The account and all the related entites will be removed from the system
Description: the system should delete automatically all the inactive accounts older than 3 years. Result: navigate on the 'system job' menu under the voice "Advance settings"
Select from the view only "reccuring system jobs". A new system job called 'Retention policy daily' should be present on the list.\
Click on it.
Check the section "selected query" and the section "next run"
- For this test: create a new account, and add to it a new case, then try to delete the new account
- The test is succefull only if the case is deleted with the releated account
I have tried to reduce as much as possibile Visual Studio and C#, in order to make the application simple to manage .
What I have used on this project -
- Javascript : The warning popup The function that disables/enables field according to the user role The Configuration page of the solution
Field Security role To prevent any other user to edit the field 'Legacy Hold and 'legacy hold details Bulk Deletion job To delete each day all the oldest inactive acccounts
- Rollup field To count if there are any cases open for the account, and retrive the latest closure date
- Action to call the custom Code Activity
- Costum Activity To create the bulk deletion job
###End