-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined value and field were created when value in a CSV row is empty or null #1714
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on. |
We are facing this issue as well. |
Same here. This is a real pain as we're having to pre-process the |
@PabloRoldan |
@pskrzybor |
@PabloRoldan @nebc-jasonfung Integer counter = 0;
List<DummyCMDT__mdt> DmcdtList = [
Select id, DeveloperName, MasterLabel, WhatTheText__c
From DummyCMDT__mdt
];
Metadata.DeployContainer mdContainer = new Metadata.DeployContainer();
for (DummyCMDT__mdt item : DmcdtList) {
try {
if (item.WhatTheText__c.equals('AbcxyZ')) { //The random string placeholder for null value
Metadata.CustomMetadata metadataRec = new Metadata.CustomMetadata();
metadataRec.fullName = 'DummyCMDT__mdt.' + item.DeveloperName;
metadataRec.label = item.MasterLabel;
Metadata.CustomMetadataValue WhatTheText = new Metadata.CustomMetadataValue();
WhatTheText.field = 'WhatTheText__c';
WhatTheText.value = null;
metadataRec.values.add(WhatTheText);
mdContainer.addMetadata(metadataRec);
counter++;
}
} catch (Exception e) {
System.debug(e);
}
}
if (counter > 0) {
try {
Metadata.Operations.enqueueDeployment(mdContainer, null);
System.debug(counter + ' Metadata records updated');
} catch (Exception e) {
System.debug(e);
}
} else {
System.debug('0 Metadata records updated');
} |
Thank you very much @pskrzybor |
Salesforce have created a Known Issue page for this problem. |
This issue is fixed in 2.20.7 (Dec 6, 2023). |
Summary
When using
sfdx force:cmdt:record:insert
command with CSV file with null or empty value in a row, undefined value and field are being createdSteps To Reproduce:
sfdx force:cmdt:record:insert --filepath dummyMdtToInsert.csv --typename DummyCMDT__mdt
Expected result
Actual result
System Information
UPDATE
Salesforce have created a Known Issue page for this problem.
Please click on the "This Issue Affects Me" button to keep yourself notified of the future updates on this bug.
The text was updated successfully, but these errors were encountered: