0

I created custom lookup with all possible Record Types to choose by user. I simply retreive List with Record Type Infos from Schema globalDescribe and pass it from apex controller to aura component. List contains also unwanted Master record type that is visible to user. Setting Default Record Type at profile level of user does not work as expected in that situation.

I wonder how to get rid of this without manual removing Master Record Type from List?

0

Seems like there is no better option for filter out Master record type instead of check if record type isMaster(). Worth to mention is that I need also to check for active record types.

Simple solution will be:

    private static Boolean isRecordTypeAvailable(RecordTypeInfo info) {
        return info.isMaster() && !info.isDefaultRecordTypeMapping() ? false : info.isAvailable();
    }

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.