salesforce-web-app-list-and-create-records
Installation
SKILL.md
When to Use This Skill
Use this skill when you need to:
- Implement list and create functionality for custom objects
- Build GraphQL queries for listing records
- Create records and update lists without page reload
- Troubleshoot deployment errors related to list and create operations
List and create records (webApplication)
Pattern
- List: Query the object via GraphQL (
executeGraphQL,uiapi.query.ObjectApiName__c). Use webApplicationFeature (GraphQL) for the connection shape (first/after, edges.node, field{ value, displayValue }). Map nodes to a simple summary type; sort client-side by date or other field if needed. - Create: Use createRecord from
@salesforce/webapp-experimental/api. See webApplicationCreatingRecords for required/optional fields and id handling. - Hook: One hook that fetches the list on mount and exposes
refetch. After a successful create, callrefetch()so the list updates without a full page reload. - Form: Collect only fields that exist on the object. For picklist fields, use option values that match the object's value set (e.g. from the object's field metadata or a known value set). Default required picklists (e.g. Status to "New", Priority to "Standard") when the object defines defaults.
- UI: Table or cards for the list; form above or on a separate route. Show loading and error states for both list and submit. Optional: dashboard widget showing a slice of the list (e.g. first N items) with a "See all" link.