... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
Describe the bug
In force-app/main/default/classes/B2CConfigurationManager.cls
Method: getPersonAccountRecordTypeDeveloperName()
Line: 97
The condition checks that the current User has the correct CRUD access.
But it should be negated.
Current Logic:
IF user has all CRUD access return NULL
ELSE do the SOQL query
`if (
// Validate that we have CRUD permissions to access this data
B2C_CRM_Sync_Default_Configurationmdt.SObjectType.getDescribe().isAccessible() &&
Schema.SObjectType.B2C_CRM_Sync_Default_Configurationmdt.fields.DeveloperName.isAccessible() &&
B2C_CRMSync_Settingmdt.SObjectType.getDescribe().isAccessible() &&
Schema.SObjectType.B2C_CRMSync_Settingmdt.fields.PersonAccount_Record_Type_Developername__c.isAccessible()
) {
return null;
}
// Get the default configuration profile
B2C_CRM_Sync_Default_Configurationmdt configurationProfile = [
SELECT Active_Configuration__r.PersonAccount_Record_Type_Developernamec
FROM B2C_CRM_Sync_Default_Configuration__mdt
WHERE DeveloperName = 'Production_Configuration'
LIMIT 1
];
// Set the output variable to contain the specified configuration property
return configurationProfile.Active_Configuration__r.PersonAccount_Record_Type_Developername__c;`
Describe the bug In force-app/main/default/classes/B2CConfigurationManager.cls Method: getPersonAccountRecordTypeDeveloperName() Line: 97
The condition checks that the current User has the correct CRUD access. But it should be negated.
Current Logic: IF user has all CRUD access return NULL ELSE do the SOQL query
`if ( // Validate that we have CRUD permissions to access this data B2C_CRM_Sync_Default_Configurationmdt.SObjectType.getDescribe().isAccessible() && Schema.SObjectType.B2C_CRM_Sync_Default_Configurationmdt.fields.DeveloperName.isAccessible() && B2C_CRMSync_Settingmdt.SObjectType.getDescribe().isAccessible() && Schema.SObjectType.B2C_CRMSync_Settingmdt.fields.PersonAccount_Record_Type_Developername__c.isAccessible() ) { return null; }
// Get the default configuration profile B2C_CRM_Sync_Default_Configurationmdt configurationProfile = [ SELECT Active_Configuration__r.PersonAccount_Record_Type_Developernamec FROM B2C_CRM_Sync_Default_Configuration__mdt WHERE DeveloperName = 'Production_Configuration' LIMIT 1 ];
// Set the output variable to contain the specified configuration property return configurationProfile.Active_Configuration__r.PersonAccount_Record_Type_Developername__c;`