function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nilesh DetheNilesh Dethe 

Issue while creating child record with two required filtered self lookup relationship with same object for two different record types?

Hi All,

I have existing implementation surrounding Account object where we have two record types lets say "A" and "B". "B" type records are already related to "A" type record through the standard 'Parent Account' self-lookup. This is working perfectly fine.

Now business wants to add two more type of Accounts lets say "C" and "D" as two new record types and want to relate them to type "A" account records as a parent while creating. So I have created two record types and two more self-lookup on Account respectively for type "C" & "D" with filter criteria of "Account Record type" equals "A" and marked them as *Required. After that, I have created two different page layout for each new record types and added the respective lookup fields on them to select the parent Account of type "A" but while creating the record of type "C" or "D", I am facing issues and not able to create child record. The error that I get is -

"Value does not exist or does not match filter criteria."

I tried putting both lookup fields on single page layout and populating both lookups but still, I am facing the same issue. The parent account of type "A" do exist in the Account object but still, it shows me same error every time while creating "C" or "D" type account record.
One workaround is to make one of them optional but that will differ the requirement from the business.

If anyone has faced or come across similar issues or implemented something similar then please do share your experience or input in order to fox this issue.

Looking forward to some awesome responses from awesome developer out there. Thank you in Advance :)

Thanks,
Nilesh Dethe
 
Best Answer chosen by Nilesh Dethe
ashish shukla 1ashish shukla 1
Hi Nilesh,

While providing filter criteria, instead of choosing "Current Record" please choose "Current Lookup" field.
It looks like record type filter is applied to the record which you are creating. While that filter is needed on the parent account when a user is choosing parent account.

Thanks and Regards,
Ashish Shukla

All Answers

ashish shukla 1ashish shukla 1
Hi Nilesh,

While providing filter criteria, instead of choosing "Current Record" please choose "Current Lookup" field.
It looks like record type filter is applied to the record which you are creating. While that filter is needed on the parent account when a user is choosing parent account.

Thanks and Regards,
Ashish Shukla
This was selected as the best answer
Nilesh DetheNilesh Dethe
Thank you, Ashish! By changing the filter criteria it did work for me.