So I am trying to create a feature that will allow users to search external databases to add accounts to salesfoce, and if not found they can create the account from scratch. However the org I am developing in has many different user profiles that determine which account record types they have access too.
Is there any way to query the available account record types based on a profile ID? I have been searching online but the only solutions I have found have been to hard code values, but as there are about a dozen profiles and account record types that doesn't seem like the best option for me. If anyone has any suggestions as to how to query account record types available for a specific profile, any help would be greatly appreciated. (I've been using userinfo.getProfileId() to get the users profile, but the queries I have been doing will only return the record types of ALL accounts in the org)