You need to sign in to do that
Don't have an account?
Bhavik Mistry
Accessing a custom field created by a managed package through Apex Class
This is my current setup:
- I have a managed package that creates a custom field on the User object (User.MyApp__MyApp_API_token__c). It stores the users API token to connect to an external system via REST.
- The Apex class I have written requests the API key from the current user, and if it does not exist, it contacts the external system to retrieve one and save it to the custom field listed above.
This workflow works fine in my developer edition account, but when I install the app in my colleague's developer edition account, the custom field is not appearing in the UI (user profile page or user detail page) and the Apex code is not saving the retrieved API token to the User object. What is peculiar is that the custom field is created when the managed app is installed, and I can see it when I access the User object through Setup --> Object Manager.
Any help or suggestions would be much appreciated.
--Bhavik
- I have a managed package that creates a custom field on the User object (User.MyApp__MyApp_API_token__c). It stores the users API token to connect to an external system via REST.
- The Apex class I have written requests the API key from the current user, and if it does not exist, it contacts the external system to retrieve one and save it to the custom field listed above.
This workflow works fine in my developer edition account, but when I install the app in my colleague's developer edition account, the custom field is not appearing in the UI (user profile page or user detail page) and the Apex code is not saving the retrieved API token to the User object. What is peculiar is that the custom field is created when the managed app is installed, and I can see it when I access the User object through Setup --> Object Manager.
Any help or suggestions would be much appreciated.
--Bhavik
And check if the field is visable to Admin or not.
Have a look to it and let me know if this works.
Regards
Rahul.