GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pkozuchowski/salesforceTools: Tools for programmatically managing Salesforce metadata.

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

Salesforce Tools

Tools for programmatically managing Salesforce metadata (currently only Profiles and PermissionSets).

Loading Profiles:

By Path

Profile p = new Profile("...my-project\\force-app\\main\\default\\profiles\\Admin.profile-meta.xml");

By Folder

    Profiles.fromDirectory("...my-project\\force-app\\main\\default\\profiles")

Modifying Profiles

Profiles.fromDirectory(profileDirectory)
    .forEach(p -> {
        p.add(new ApplicationVisibility("Application", true, true));
        p.add(new FieldPermission("Account.Custom_Field_1__c", true, false));
        p.add(new FieldPermission("Account.Custom_Field_2__c", true, true));
        p.add(new ObjectPermission("Custom_Object__c", true, false, true, true, false, false));
        p.add(new TabVisibility("Application_Log__c", TabVisibility.DefaultOn));
        p.saveFile();
    });

Removing XML nodes by predicate

Profiles.fromDirectory(profileDirectory)
    .forEach(p -> {
        p.remove((MetadataNode node) -> node.getMetadataName().contains("trailheadapp__"));
        p.saveFile();
    });

Merging Profiles

Merge will take all permissions from one profile and apply it onto another without creating duplicates.

Retain only those permissions that are available on another Profile

retainSamePermissions() accepts another Profile which will serve as a base and strips all permissions that are not listed on base profile. The goal is to streamline target profile to have the same set of permissions as base profile.

Profile p = new Profile("...my-project\\force-app\\main\\default\\profiles\\Dealer Agent.profile-meta.xml");
p.retainSamePermissions(new Profile("...my-project\\force-app\\main\\default\\profiles\\Dealer Supervisor.profile-meta.xml"));
p.saveFile();

About

Tools for programmatically managing Salesforce metadata.

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.