데이터 이관 할 떄 위와 같이 INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST 오류가 발생 했습니다.
당연히 해당 컬럼의 Pick List를 체크해서 해당되는 값을 지정 한 것을 확인 했습니다.
또한 해당 필드에 Field Dependencies 를 확인 했으나 문제가 없었습니다.
무엇이 문제일까?
결론 만 말 하자면 해당 Record Type 의 Page Layout에 해당 항목이 존재하지 않았기 때문입니다.
특별히 등록 시점에는 간단한 항목 만 등록하고 이 후 상세 수정 할 떄는 전체 항목을 수정 할 수 있도록 설계되어 등록 시점과 상세 시점에 Record Type이 달랐고 등록 할 떄는 해당 항목이 없어기 때문에 문제가 발생하였습니다.
해당 항목은 신규 등록 시점에서는 매핑 항목에서 제거하고 수정 할 때 다시 매핑처리하여 문제를 해결 하였습니다.
아래는 Salesforce의 관련 문서 입니다. 참고하시기 바랍니다.
레코드를 만들 경우 ‘제한된 선택 목록 필드의 잘못된 값’ 오류가 표시됩니다.
사용자가 Salesforce에서 새 레코드를 만들 경우 다음 오류가 발생할 수 있습니다.
오류 메시지 텍스트:
오류: 잘못된 데이터입니다.
아래의 모든 오류 메시지를 검토하고 데이터를 수정하십시오.
‘제한된 선택 목록 필드의 잘못된 값: PicklistValue’
참고:
- Salesforce Classic에서 이 오류는 영향을 받은 필드(관련 필드: FieldName)를 표시합니다.
- Lightning Experience에서 이 오류는 ‘제한된 선택 목록 필드의 잘못된 값: PicklistValue’를 표시합니다.
‘잘못된 값’ 오류의 원인
이 오류는 오류 메시지에서 참조한 선택 목록 필드가 다음의 각 조건을 충족할 경우 발생합니다.
- 참조한 선택 목록 필드에는 ‘선택 목록을 값 집합에 정의된 값으로 제한‘이 활성화로 설정되어 있습니다.
- 참조한 선택 목록 필드는 종속 선택 목록입니다.
- 페이지 레이아웃에는 제어 및 종속 선택 목록 필드가 포함되어 있지 않습니다.
- 참조된 선택 목록 필드에는 기본값이 설정됩니다.
- 개체에 레코드 유형이 포함된 경우 – 이 오류는 레코드 유형을 기본값으로 설정하는 경우에 발생합니다.
- 개체에 레코드 유형이 포함되지 않은 경우 – 이 오류는 선택 목록을 값으로 설정하는 경우에 발생합니다.
- 모든 레코드 유형에는 사용 가능한 항목 아래가 아니라 선택한 항목 섹션에서 새로 만든 선택 목록이 선택되어 있어야 합니다.
선택 목록 필드가 포함된 개체의 레코드를 저장할 경우 Salesforce에서 기본값 입력을 시도합니다. 제어 값이 설정되어 있지 않고 선택 목록이 종속 값만 허용하도록 제한되어 있으므로 레코드 저장 시 오류가 발생합니다.
추가 원인:
- Sandbox에서 선택 목록 필드를 배포하고 레코드 유형의 값이 선택되지 않은 경우 이 오류가 발생할 수 있습니다.
- ‘레이블’ 및 ‘API 이름’의 값이 서로 다르고 업데이트 시 ‘레이블’ 이름을 사용할 경우 이 오류가 발생할 수 있습니다.
솔루션
‘잘못된 값’ 오류 해결
이 문제를 해결하려면 레코드 유형 또는 선택 목록 필드에서 기본값을 제거하십시오(설정된 위치에 따라 다름).
기본값 제거: 레코드 유형
Lightning Experience의 경우
- 기어 아이콘| 설정을 선택합니다.
- 개체 관리자를 클릭합니다.
- 선택 목록이 포함된 레코드 유형의 개체를 선택합니다.
- 레코드 유형을 선택합니다.
- 선택 목록이 포함된 레코드 유형을 선택합니다.
- 변경할 선택 목록의 편집을 클릭합니다.
- ‘기본값’ 필드에서 –없음–을 선택합니다.
- 저장을 클릭합니다.
Salesforce Classic의 경우
- 설정 | 사용자 정의를 선택합니다.
- 선택 목록이 포함된 개체를 선택한 후 레코드 유형을 선택합니다.
- 선택 목록이 포함된 레코드 유형의 이름을 선택합니다.
- 선택한 레코드 유형 이름의 선택 목록에서 편집을 클릭합니다.
- ‘기본값’ 필드에서 –없음–을 선택합니다.
- 저장을 클릭합니다.
기본값 제거: 선택 목록
Lightning Experience의 경우
- 기어 아이콘| 설정을 선택합니다.
- 개체 관리자를 클릭합니다.
- 선택 목록이 포함된 개체를 선택합니다.
- 필드 및 관계를 선택합니다.
- 변경할 선택 목록 필드를 선택합니다.
- 기본값으로 설정된 선택 목록 값의 편집을 클릭합니다.
- ‘기본값’ 확인란을 선택 취소합니다. 참고: 이 값을 마스터 선택 목록의 기본값으로 설정하십시오.
- 저장을 클릭합니다.
Salesforce Classic의 경우
- 설정 | 사용자 정의를 선택합니다.
- 선택 목록이 포함된 개체를 선택한 후 필드를 선택합니다.
- 변경할 선택 목록 필드를 선택합니다.
- 기본값으로 설정된 선택 목록 값의 편집을 클릭합니다.
- ‘기본값’ 확인란을 선택 취소합니다. 참고: 이 값을 마스터 선택 목록의 기본값으로 설정하십시오.
- 저장을 클릭합니다.
참고 항목:
Error ‘bad value for restricted picklist field’ appears when a record is createdPublish Date: 2021년 3월 3일Description
Users may receive the following error when they attempt to create a new record in Salesforce:
Error message text:
Error: Invalid Data.
Review all error messages below to correct your data.
‘bad value for restricted picklist field: PicklistValue’
Notes:
- In Salesforce Classic, this error displays the affected Field (Related field: FieldName).
- In Lightning Experience, this error displays ‘bad value for restricted picklist field: PicklistValue’
Cause of the ‘Bad Value’ error
This error occurs when the picklist field referenced in the error message meets each of the following conditions:
- The referenced picklist field has ‘Restrict picklist to the values defined in the value set‘ set to Enabled.
- The referenced picklist field is a dependent picklist.
- The page layout does not include both the controlling and dependent picklist fields.
- A default value is set for the referenced picklist field:
- If the object includes Record Types – This error occurs if the record type sets the default value.
- If the object does not include Record Types – This error occurs if the picklist field sets the value.
- All record types should have the newly create picklist selected in the Selected items section and not under available items.
- Initiate a Mass Quick Action with Predefined Value Set
- Any active trigger on the object where the field is used can give the same error.
When you attempt to save a record in the Object that contains this picklist field, Salesforce attempts to populate the default value. Since the controlling value is not set and the picklist is restricted to only allow the dependent values, you will receive this error when you attempt to save the record.
Additional Causes:
- This error can occur when you deploy a picklist field from sandbox and the values are not selected on the record types.
- This error can occur when the value ‘Label’ and ‘API Name’ are different in the values, and you use the ‘Label’ name in the update.
Resolution
Resolve the ‘Bad Value’ error
To resolve this issue, remove the default value from the Record Type or picklist field (depending on where it is set).
Remove the default value: Record Type
In Lightning Experience
- Select the gear icon| Setup.
- Click Object Manager.
- Select the object for the record type that contains the picklist.
- Select Record Types.
- Select the record type that contains the picklist.
- Click Edit for the picklist you wish to change.
- In the ‘Default’ field, select –None–.
- Click Save.
In Salesforce Classic
- Select Setup | Customize.
- Select the object containing the picklist, then select Record Types.
- Click the name of the record type that contains the picklist.
- On the picklist of your choice, click Edit.
- In the ‘Default’ field, select –None–.
- Click Save.
Remove the default value: Picklist
In Lightning Experience
- Select the gear icon| Setup
- Click Object Manager.
- Select the object that contains the picklist.
- Select Fields and Relationships.
- Select the picklist field you wish to change.
- Click Edit for the picklist value that is set as the Default.
- Deselect the ‘Default’ checkbox. Note: Make this value the default for the master picklist.
- Click Save.
In Salesforce Classic
- Select Setup | Customize
- Select the object containing the picklist, then select Fields.
- Select the picklist field you wish to change.
- Click Edit for the picklist value that is set as the Default.
- Deselect the ‘Default’ checkbox. Note: Make this value the default for the master picklist.
- Click Save.