Basically I want to use the UI-API to get dependent picklist values to use in custom lightning page. To access the ui-api, I need to make rest callout from apex. So I created a connected App and Auth Provider with same client Id and secret. While configuring Named credentials, it fails to authorize the changes while saving.
I am getting "OAUTH_APPROVAL_ERROR_GENERIC : An unexpected error has occured during authentication. Please try again." while trying to save the Named Credentials for the same Org.
I need answers for the following questions. 1. Can I access ui-api within same salesforce org ? 2. Is there any other way to get dependent picklist and recordtype based picklist?