解决VSCode中SF全量元数据检索的GenAiPromptTemplate权限不足问题
Fix for INSUFFICIENT_ACCESS Error on GenAiPromptTemplate Metadata Retrieve
Root Cause
GenAiPromptTemplate is a metadata type tied to Salesforce's AI features (e.g., Einstein GPT), not a standard object. Even with Modify All Data and View All Data permissions, specific permissions for this metadata type are required to retrieve it via the API.
Resolution Steps
Assign the AI Prompts Permission Set
- Go to Setup → Users → Permission Sets.
- Find the
AI Promptspermission set (automatically created when Einstein GPT features are enabled in your org). - Click Assign, select your admin user from the list, and save the assignment.
Verify Critical Permissions
- Confirm your admin profile has
Customize Applicationenabled (check via Setup → Profiles → [Your Admin Profile] → System Permissions). - Double-check that
API Enabledis still active (you noted this is already enabled, but rule out accidental changes).
- Confirm your admin profile has
Retry the Retrieve Command
- After updating permissions, run the command again:
sfdx force:source:retrieve -x manifest/package.xml -u vscodeOrg
- After updating permissions, run the command again:
Alternative: Exclude GenAiPromptTemplate (If Unneeded)
If you don't require this metadata type, modify your package.xml to remove the <types> entry for GenAiPromptTemplate, then re-run the retrieve command.
内容的提问来源于stack exchange,提问作者Carolyn Cordeiro
相关产品推荐
相关产品推荐

