I have a business rule in ProjectTypeComplianceBridge that checks for duplicate records as follows:
If EXISTS ProjectTypeComplianceBridge WHERE (ProjectTypeComplianceBridge.ComplianceStandard=ThisProjectTypeComplianceBridge.ComplianceStandard AND ProjectTypeComplianceBridge.ProjectType=ThisProjectTypeComplianceBridge.ProjectType) Then
REPORT ERROR 'A record already exists for this Compliance Standard and Project Type'
This is executing even when there are no existing records in ProjectTypeComplianceBridge.
Use case
Entered a new ProjectTypeComplianceBridge record. Worked
Tried to enter a new ProjectTypeComplianceBridge with values that would cause duplicates. Worked (good) - got business rule error message.
Deleted ProjectTypeComplianceBridge. Worked.
Searched objects for ProjectTypeComplianceBridge. No data found - good
Tried to enter a new ProjectTypeComplianceBridge record with same values. Got the duplicates business rule error message (bad).
Locked Business Space in Config tool. Made no changes.
Put under test mode with NO INITIAL DATA.
Run test mode
Searched objects for ProjectTypeComplianceBridge. No data found - good. Tried to enter a new ProjectTypeComplianceBridge record with same values. Got the duplicates business rule error message (bad).
Searched objects for ProjectTypeComplianceBridge. No data found.
So, seems this record that was initially entered is "stuck" somewhere, and does not show up.
The code for the business rule seems pretty straightforward.