To create Asset using custom action on Account Record page in Lightning Component, you must have created the Lightning component that needs to be invoked. Check my blog post on Create Account-Asset Record-specific action in Lightning Component.
Create an Object-Specific Action
- From SetUp, Click on the Object Manager, select Account .
- From the Account object management settings, go to Buttons, Links, and Actions and click New Action.
- For Action Type, select the Lightning Component you created.
- Immediately, a Lightning Component field comes up where you need to select the component to use. For this post, I have created AccountAssetAction.cmp
- For Standard Label Type, select None
- Note: If you select any of the standard label, there will be error “Error: Field cannot be set for type Lightning Component” as seen below.
- For Label choose a name that best fit your use case e.g. New Account Asset
- For Name, there can be underscore but no space. It follows Salesforce API name e.g. New_Account_Asset
- Add Description if desired
- Click Save
- Again, from the Account management setting, go to Page layout
- Click Mobile and Lightning Component on the left column and drag New Account Asset to Mobile and Lightning Component panel
- Rearrange the actions by placing this new one on the first row
- Click the Related List and drag Asset object below Contact so that it is visible on Account detail page and
- Click Save
- On Sales App, and click on Account.
- Click on any Account record. e.g. Edge Communications
- On the top right-hand, click on the New Account Asset button created
- Fill in the fields
- Click Save button
Pingback: Create Account-Asset Record-Specific Action in Lightning Component -