A .NET Framework error occurred during execution of user defined routine or aggregate 'USP_TASK_GRANT_IMPLIED_FEATUREPERMS':
System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_SYSTEMROLEPERM_DATAFORMINSTANCE_DATAFORMINSTANCECATALOGID". The conflict occurred in database "BBInfinity", table "dbo.DATAFORMINSTANCECATALOG", column 'ID'
Occurs when using the Assign tasks form from the System Role page
This error occurs when granting permissions to a task that references a feature that does not exist in the database’s feature catalog. The constraint and table names may be different, for example when the task references a record operation rather than a data form. This situation may come up when a custom feature has been partially deployed or when a custom feature has been deployed, then partially unloaded. To avoid this error, only grant permissions to tasks that correspond to features that have been fully deployed in your environment.
After the above error occurs, close the form before attempting to save it again. Even after unchecking the task that caused the issue, the form will fail to save until it is closed and reopened. After encountering the above error, the following error will occur unless you cancel the data form then click Assign tasks again.
Data could not be saved. Violation of UNIQUE KEY constraint 'UC_SYSTEMROLETASK_SYSTEMROLEID_TASKID'. Cannot insert duplicate key in object 'dbo.SYSTEMROLETASK'. The duplicate key value is (<<ID>>,<<ID>).