Export Salesforce Schema in Excel sheet using this plugin built on top of SFDX
- Export Selcted OR All object Metadata in Excel sheet
- Export dependent Picklists in Excel sheet
- Git
- SFDX
Open COnsole / Terminal and Clone this repository at appropriate location by runing command
https://github.com/JitendraZaa/Schema-Exporter.git
Navigate to folder Schema-Exporter
then
run command sfdx plugins:link
Assume you have org alias authenticated in sfdx with name jit11
Run below sample command against sfdx org jit11
sfdx schema:build -u jit11 -o "User,Account,Lead" -p "some/path/ObjectInfo.xlsx"
-u : Authenticated user -o : Comma separated list of object to fetch -p : Path where excel sheet needs to be generated
If we run below command without any object, it will export every object of Org
sfdx schema:build -u jit11 -p "some/path/ObjectInfo.xlsx"
- Add user name, profile name in summary so that we know creatable , updatable etc are on which profile
- Reorder fields so that most commonly populated fields displayed first and least populated fields like creatable, formula etc later
- try to link all objects with tab. Attempted it but didnt work
- In summary , along with object name, show total field and total custom fields
- Show validation rules, page layout, Process builder & trigger associated with Object
- Check if object is empty with 0 recoerds. Use SOQL like 'Select Count(ID) FROM object X limit 50000'. It will help to say records are 50k+ or not
- How many fields on each pagelyaouts
- Which pagelayouts are unused and not assigned against any profile
- Matrix of profile with object permissions
- creating hyperlink cell in excel4node
//=HYPERLINK("[Budget]June!E56", E56), budget sheet name, June workbook name
//let linkFormula = 'Hyperlink('+element.name+'!A1,"'+element.name+'")' ;
//ws_info.cell( rowNumber + row_Offset_InfoSheet,4 + col_Offset_InfoSheet).formula(linkFormula);
//let linkFormula = element.name;
//ws_info.cell( rowNumber + row_Offset_InfoSheet,4 + col_Offset_InfoSheet).string(linkFormula);
- Getting object permissions from profile Blog Link
SELECT Id, SObjectType, PermissionsRead, PermissionsCreate, PermissionsEdit , PermissionsDelete, PermissionsModifyAllRecords , PermissionsViewAllRecords FROM ObjectPermissions WHERE parentid in (select id from permissionset where PermissionSet.Profile.Name = 'System Administrator')
- Read Permission Sets
SELECT ID,Description,HasActivationRequired,IsCustom,IsOwnedByProfile,Label,LicenseId,PermissionSetGroupId,ProfileId,Type FROM PermissionSet Where IsOwnedByProfile = false
- Handling controlling picklist is trick as per this documentation & this stack exchange , decoding logic would be needed to know which value is ACTUALLY controlling value. Therefore commenting this WIP code. Solution documented in type script
Rune below Command
sfdx plugins:uninstall "<Path of Plugin Located>"
rm -rf node_modules
yarn cache clean
yarn
sfdx plugins:link
-
Install Type Script
sudo npm install -g typescript
-
Clean Node Cache
npm cache clean -f
-
Delete node_module folder
rm -rf node_modules
-
Build all needed node modules
npm i
Ornpm install
-
Uninstall Salesforce DX
sudo rm -rf /usr/local/sfdx sudo rm -rf /usr/local/lib/sfdx sudo rm -rf /usr/local/bin/sfdx sudo rm -rf ~/.local/share/sfdx ~/.config/sfdx ~/.cache/sfdx sudo rm -rf ~/Library/Caches/sfdx sudo rm -rf /usr/local/sf sudo rm -rf /usr/local/bin/sf
-
install Salesforce DX using Node
npm install sfdx-cli --global
-
install sf executable
npm install @salesforce/cli --global