I am trying to create a Visualforce page / form that displays certain custom settings are subject to frequent change and allow the admin to update the values. I wrote the first section but I get a duplicate record error when I try to save the form.

Error = duplicate value found: SetupOwnerId duplicates value on record with id: 00Dc0000003wJLs

<apex:page id="HealthCheckConsole" lightningStylesheets="true" standardController="health_check_console__c">
<apex:pageMessages />
<apex:form >
    <apex:pageBlock title="Health Check Values">
        <apex:commandButton action="{!save}" value="Save"/>
        <apex:pageBlockSection title="Pardot Score Values" columns="2" collapsible="true">
            <apex:outputtext label="Pardot Upper Quartile:" value="{0, number, 00.00}">
            <apex:param value="{!$Setup.health_check_console__c.pi_upper_quartile__c}"/>
            <apex:inputField value="{!health_check_console__c.pi_upper_quartile__c}"/>
            <apex:outputText label="Pardot Median Value" value="{0, number, 00.00}">
            <apex:param value="{!$Setup.health_check_console__c.pi_median__c}"/>
            <apex:inputField value="{!health_check_console__c.pi_median__c}"/>
            <apex:outputText label="Pardot Lower Quartile" value="{0, number, 00.00}">
            <apex:param value="{!$Setup.health_check_console__c.pi_lower_quartile__c}"/>
            <apex:inputField value="{!health_check_console__c.pi_lower_Quartile__c}"/>
  • 2
    Do you receive this error if you try to update it from the setup --> custom settings as well? I see a known issue which was reported and fixed long time back, suspect if this is somehow related. – Jayant Das Aug 23 '18 at 20:16
  • I just tried and it did let me update the settings in the Sandbox – Brooks Johnson Aug 23 '18 at 20:44
  • How about creating new? Does it let you create a new one? And also the issue in your VF page, is it during a create or update scenario? – Jayant Das Aug 23 '18 at 20:48
  • Also can you update your post with the controller code to be able to see if there are any related issues out there? – Jayant Das Aug 23 '18 at 21:38
  • Sorry, some other work pushed this to the side for a day. I am just using the standard controller on this. I can adjust the settings without issue if I do it manually from Setup. – Brooks Johnson Aug 27 '18 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.