I'm new to using SFDMU and currently trying to update 2 existing fields which we want values to be removed:
- Field1__c data type is Encrypted String(16)
- Field2__c data type is Text(16)
I'm using the following command sfdx sfdmu:run --targetusername OrgName
to update the target org, but unfortunately, only the Field1__c is being updated, while Field2__c values remain as is.
I tried different patterns I could use but it did not work. And if I add a different text field to be updated along with the 2 fields, it gets updated but still, not the Field2__c. There is no issue with the generated log which I've shared below, and csv file generated in target folder shows that Field1__c was nullified successfully while Field2__c values still exist.
My workaround with this issue was to use a different command which exports the records via csv file, update it and import the same using a different command of SFDMU. But unfortunately, the requirement is to use "updateWithMockData": true
instead of manually changing the data via csv.
Do you think I miss something in my json file that might've caused this issue only to a specific field? Or am I using the correct pattern to update the field?
Here is my sample export.json file:
{
"objects": [
{
"query": "SELECT ID, Field1__c, Field2__c FROM Opportunity WHERE Field2__c!=NULL",
"operation": "Update",
"externalId": "Id",
"mockFields": [
{
"name": "Field1__c",
"includedRegex": "*",
"pattern": "c_set_value(null)"
},
{
"name": "Field2__c",
"includedRegex": "*",
"pattern": "c_set_value(null)"
}
],
"updateWithMockData": true
}
]
}
Here is the logs after running the sfdmu command:
DATA RETRIEVAL SUMMARY.
[17:41:07.699] {Opportunity} The total amount of the retrieved records: 10/10.
UPDATING THE TARGET (STAGE 1) ...
[17:41:07.715] {Opportunity} Amount of records to Update: 10.
[17:41:07.726] {Opportunity} The Update API operation has been started using REST API.
[17:41:07.730] [Job# REST:Update] {Opportunity} The job has been created. Uploading data ...
[17:41:14.277] {Opportunity} The Update API operation has been completed.
[17:41:14.287] {Opportunity} The Target has been updated. Totally processed 10 records.
[17:41:14.291] The Target (STAGE 1) has been updated. Totally processed 10 records.
UPDATING THE TARGET (STAGE 2) ...
[17:41:14.301] Nothing was updated.
TRIGGERING ADD-ON EVENTS ...
[17:41:14.310] No Add-On modules found to run.
DATA PROCESSING SUMMARY.
[17:41:14.320] {Opportunity} Totally processed 10 records.
[17:41:14.326] Writing to C:\Users\myName\MissingParentRecordsReport.csv ...
TRIGGERING ADD-ON EVENTS ...
[17:41:14.336] No Add-On modules found to run.
[17:41:14.353] Command succeeded.
[17:41:14.357] Execution of the command sfdmu:run has been completed. Exit code 0 (SUCCESS).
[17:41:14.361] Total time elapsed: 00h 02m 14s 194ms .