salesforce-commerce-cloud

SFCC: Is there a way to automatically remove custom attribute definitions


We have a pretty old project where we have a lot of custom attribute definitions but do not trust our sites/site_template/meta/system-objecttype-extensions.xml to be complete.

Does anybody know of a way to remove a defined set of custom attribute definitions automatically? We can identify quite a lot that are definitely not used anymore but I'm missing the DELETE import functionality available for other types of data in SFCC.

Tx a lot for your help!


Solution

  • What to do, so I wrote my own parser / analyser / merger: https://github.com/Andreas-Schoenefeldt/SFCCAnalyser#combine-and-analyse-system-objecttype-extension-xml-files

    It can be used like this:

    1. put all xml files you would like to merge into one in ./data/meta-xmls/
    2. run node combine-xml.js
    3. the resulting merged and cleaned xml file will be in ./data/meta-xmls/combined.xml

    The resulting file will contain all custom attribute definitions accross the systems, so it can then safely imported checking the Delete existing attribute definitions and attribute groups not contained in the import file, including attribute definitions marked as "externally-defined".