{"id":15567291,"url":"https://github.com/scolladon/dce","last_synced_at":"2026-03-18T17:32:52.937Z","repository":{"id":86399045,"uuid":"124103257","full_name":"scolladon/DCE","owner":"scolladon","description":"Apex Dynamic Code Execution","archived":false,"fork":false,"pushed_at":"2018-11-28T21:54:07.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T15:55:48.043Z","etag":null,"topics":["apex","process-builder","salesforce","trigger","workflow-rule"],"latest_commit_sha":null,"homepage":null,"language":"Apex","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scolladon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-06T16:04:46.000Z","updated_at":"2023-06-29T13:54:06.000Z","dependencies_parsed_at":"2023-03-13T20:00:54.124Z","dependency_job_id":null,"html_url":"https://github.com/scolladon/DCE","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"8a2f94906f7c662d82e4aa733acad89c96949aea"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scolladon%2FDCE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scolladon%2FDCE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scolladon%2FDCE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scolladon%2FDCE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scolladon","download_url":"https://codeload.github.com/scolladon/DCE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246145014,"owners_count":20730494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apex","process-builder","salesforce","trigger","workflow-rule"],"created_at":"2024-10-02T17:10:37.719Z","updated_at":"2025-10-14T12:10:25.035Z","avatar_url":"https://github.com/scolladon.png","language":"Apex","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Apex Dynamic Code Execution\nApex Library to dynamically prevent/allow code execution\nTest Coverage : 100%\n\nThis Library aims to dynamically control code execution in apex, validation rule and workflow rule / Process Builder.\n\n## Getting Started\n\nHere we go !\n\n### Installing\n\n\u003ca href=\"https://githubsfdeploy.herokuapp.com?owner=scolladon\u0026repo=DCE\"\u003e\n  \u003cimg alt=\"Deploy to Salesforce\" src=\"https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/src/main/webapp/resources/img/deploy.png\"\u003e\n\u003c/a\u003e\n\n### Caching\n\nThis implementation use Platform Cache (Session Cache).\nEnsure you have platform Cache enabled or the deployment will fail.\n\nIf you **do not want** the version with the Platform Cache, copy the code in the class DCE_NOCACHE.txt to DCE.cls instead\n\n\n### Trigger\n\nIn order to apply the dynamic code execution, wrap you code in a if statement :\n```java\ntrigger myTrigger on myObject (after update) {\n  if(DCE.allow('myTrigger')) {\n    MyObjectTriggerDelegate();\n  } \n}\n```\n\nIf you user as the value \"myTrigger\" selected in the multipicklist DCE_TriggerBlackList__c the DCE.isAllowed('myTrigger') condition will be false.\n\nYou can force to prevent all in your code or in your script either by checking the field DCE_AllTrigger__c or by setting the preventAll boolean to true dynamically :\n```java\nDCE.preventAll = true;\n```\n\nYou can force to prevent execution after n execution :\n```java\nDCE.allowUntil('myTrigger', 2);\n```\nThis way the trigger myTrigger will be executed 2 times.\n\n### Validation Rule\n\nIn order to by pass validation rule you can configure your user with the multipicklist DCE_VBL__c to filter what you want to prevent or you can use the checkbox DCE_AV__c to prevent all.\nThen configure you're validation rule this way :\n```java\nNot($User.DCE_AV__c) \u0026\u0026  NOT(INCLUDES($User.DCE_VBL__c,'MyValidationRule')) \u0026\u0026 MyConditions\n```\n\n### Workflow Rule, Process Builder\nIn order to by pass Workflow rule or Process Buidler you can configure your user with the multipicklist DCE_WBL__c to filter what you want to prevent or you can use the checkbox DCE_AW__c to prevent all.\nThen configure you're workflow rule / Process Builder this way :\n```java\nNot($User.DCE_AW__c) \u0026\u0026  NOT(INCLUDES($User.DCE_WBL__c,'MyFlow')) \u0026\u0026 MyConditions\n```\n\n## Authors\n\n* **Sebastien Colladon** - *Initial work* - [scolladon](https://github.com/scolladon)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscolladon%2Fdce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscolladon%2Fdce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscolladon%2Fdce/lists"}