Study for the Administrator Certification Exam > Object Manager and Lightning App Builder (15%) > Customize a Salesforce Object > Create Lookup Filters
The Rundown
- Lookup filters limit the records available in the lookup.
Lookup field에서 선택할 수 있는 레코드를 제한하는 방법- A lookup filter can reference other fields on the same record (source);
같은 레코드의 다른 필드 - fields on the records of the lookup object (target);
Lookup 대상 객체의 필드 - fields on the user’s record, profile, and role;
User의 정보, Profile / Role - fields on records directly related to the target object
Lookup 대상과 연결된 다른 객체
- A lookup filter can reference other fields on the same record (source);
- 사용자가 아무 레코드나 선택하지 못하게 조건을 걸어 데이터 품질을 유지
요청사항
- reps to be able to capture the name of the backup rep on their cases when they are away from the office
휴가중인 사람이 담당 Case의 임시담당자 이름을 볼수 있게 - ensure that new cases can only be associated to contacts from the same account
새 Case는 같은 Account의 Contact에만 연결되도록 보장한다.
Case.AccountId = Contact.AccountId
Create a Lookup Relationship
Case 객체에 Backup Agent라는 필드를 하나 추가하는데, 값은 언제나 User의 Name만 값으로 들어가도록 Lookup Relationship으로 만든다.
- Setup > Object Manager > Case > Fields & Relationships > New
- Data Type: Lookup Relationship
- Next
- Related To: User
- Next
- Field Label:
Backup Agent - Field Name:
Backup_Agent - Description:
Used to identify the assigned support rep when case owner is away — for support use only. - Help Text:
Who is the assigned support rep when case owner is away? - Lookup Filter > Show Filter Settings
- Field:
User: Profile: Name - Operator: equals
- Value:
Support User
- Field:
- Field Label:
- Next
- Select ✅ Read-Only (in the header, so all read-only check boxes are checked)
- Support User > Deselect 🔲 Read-Only
- Next
- Uncheck 🔲 Close Case Layout
- Save!
Add Filter to Lookup Field
필드에 필터추가하기. Case의 Contact Name에 오직 해당 Account의 User만 값으로 가지게 끔 필터를 추가한다.
- Setup > Case > Fields & Relationships > Contact Name > Edit
- Lookup Filter > Show Filter Settings
- Field:
Contact Name: Account ID - Operator: equals
- Field:
Case: Account ID
- Field:
- Check ✅ Required
- Lookup Filter > Show Filter Settings
- Save!
넌 왜 항상 만들기만 하고 결과를 보여주지를 않냐? 이게 어디서 어떻게 쓰이는지를 보여줘야 기억에도 잘 남고 왜 이걸 했는지도 알지..그냥 설정만 하고 계속 넘어가니까 뭘 하긴 했는데 정확히 뭘 한건지 모르겠단 말이야….