forcedotcom / SFDX-Data-Move-Utility

SFDMU is a cutting-edge Salesforce data migration tool for seamless org population from other orgs or CSV files. It handles all CRUD operations on multiple related objects in one go.
BSD 3-Clause "New" or "Revised" License
433 stars 73 forks source link

[QUESTION] - How to use the add-on API to run a SF CLI Command #787

Closed jorgesolebur closed 6 days ago

jorgesolebur commented 1 month ago

I was reviewing the documentation you have around add-ons API, specially the ones defined in this section of your website: https://help.sfdmu.com/full-documentation/export-json-file-objects-specification/addon-manifest-definition-object#configuring-add-ons.

As I can see from the examples in the above section form the URL I shared, you are using the beforeAddons or afterAddons to call a SF CLI command to do some actions : CleanShot 2024-06-06 at 16 21 24@2x

So this is how I wrote my beforeAddons and afterAddons, calling SF CLI commands (but not sfdmu, but instead project deploy start as I need to enable and disable validation rules from a managed package in order to do the data operations): CleanShot 2024-06-06 at 16 22 59@2x

The full export JSON is here: export.json

However, as you can see in the logs, when running SFDMU command with that export file : sf sfdmu run -s csvfile -u targetSandbox -p ./scripts/sfdmu/metaDevToRepo/

The logs show that there is no add-ons module to be executed... 2024-06-06__14_52_28.log

Am I missing something? I thought this does not require a "custom add-on API" because I do not need to execute custom logic written in JS/TS. I just want to execute a SF CLI command to do a deploy, execute anonymously an apex code or anything that can be done through SF CLI. Is that correct? Or do I need to create a custom add-on API (following the documentation from link https://help.sfdmu.com/full-documentation/add-on-api/custom-sfdmu-add-on-api) ?

Thanks in advance

hknokh commented 1 month ago

Hello, @jorgesolebur

Thank you for reaching out. I will do my best to assist you as quickly as possible and will keep you updated on my progress.

Cheers

hknokh commented 1 month ago

Hello,

I wanted to let you know that I am still reviewing your case and will inform you as soon as I have any updates. Due to my current time constraints, this process may take longer than usual.

Thank you for your patience and understanding.

Best regards

hknokh commented 1 week ago

Hello,

You need to build your own add-on for SFDMU using the provided documentation. Inside your add-on module, you can call and require your custom file. SFDMU can execute only modules that are in the correct format and implementation, which align with the SFDMU Add-On API. Please rebuild your module and check the path..

github-actions[bot] commented 1 week ago

This case has been marked as 'to-be-closed', since it has no activity for the 3 days.
It will be automatically closed in another 3 days of inactivity.

github-actions[bot] commented 6 days ago

This case has been closed, since it has no activity for the last 6 days. Feel free to reopen it, if you need more help.