0

I have placed my custom component in record detail page .

I am trying to call the standard action NewNote Or FeedItem.ContentNote from my component using lightning:quickActionAPI. But I am not able to call that particulerly action .

Error Received:

The action you specified isn’t available on the current record page.

I added that quick action to page layout. But still, I can't access that from the component.

There is a method called getAvailableActions in lightning:quickActionAPI . That too not listed out the above mentioned standard actions.

NOTE: I am able to call other standard actions except NewNote Or FeedItem.ContentNote

Refered Document

Is anyone know the reason for this?

0

Use below code:

({  
    createNewNote: function (cmp, event, helper) {
        var actionAPI = cmp.find("quickActionAPI");

        // check available actions
        actionAPI.getAvailableActions().then(function(result){
            console.log("AvailableActions => ", JSON.stringify(result));
        })
        .catch(function(err){
            console.error("ERROR => ", err);
        });

        // new note
        var args = {actionName: "NewNote"};
        actionAPI.selectAction(args).then(function(result){
            console.log("NewNote => ", JSON.stringify(result));
        }).catch(function(err){
            console.error("ERROR args => ", err.errors);
        });
    }
})
  1. First check if the action is available through getAvailableActions. You will see something like below:
{
  "actions": [
    {
      "actionName": "NewCase",
      "recordId": "0010K000027Ja5cQAC",
      "type": "QuickAction"
    },
    {
      "actionName": "NewNote",
      "recordId": "0010K000027Ja5cQAC",
      "type": "QuickAction"
    },
    {
      "actionName": "NewTask",
      "recordId": "0010K000027Ja5cQAC",
      "type": "QuickAction"
    },
    {
      "actionName": "NewEvent",
      "recordId": "0010K000027Ja5cQAC",
      "type": "QuickAction"
    },
    {
      "actionName": "LogACall",
      "recordId": "0010K000027Ja5cQAC",
      "type": "QuickAction"
    },
    {
      "actionName": "SendEmail",
      "recordId": "0010K000027Ja5cQAC",
      "type": "QuickAction"
    }
  ],
  "success": true,
  "parentContext": null
}
  1. Now, as NewNote is available, I am able to use it using selectAction and the new note creation form appears.

You need to have New Note in Mobile & Lightning Actions for respective page-layout

enter image description here

| improve this answer | |
0

You need to add it in Mobile & Lightning Actions in respective page-layout. You can check the page-layout in flexipage

I already did. You can see that from below screen shots.

Configuration Page: Image 1

Record Detail page: Image 2

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.