• sunil Pal 13
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi All,

I am trying to call Account action Lets say Edit from Lightning component. I have used qucik Action API but always its gives me error:
"The action you specified isn’t available on the current record page". I Edit button is on page layout as well.

My code is below:
Component:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" extends="c:base">
    <aura:attribute name="acc" type="Account"/>
    <aura:attribute name="recordId" type="String"/>
    
    <force:recordData aura:id="recordLoader"
                      recordId="{!v.recordId}"
                      fields="Id, Name"                
                      targetFields="{!v.acc}"
                      targetError="{!v.recordLoadError}"
                      />
    
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
     <lightning:quickActionAPI aura:id="quickActionAPI" />    
        <div class="slds-page-header">
            <lightning:buttonGroup>
                <lightning:button variant="neutral" label="Check for New Data" onclick="{!c.checkNewData}"/>        
            </lightning:buttonGroup>
        </div>    
</aura:component>

Controller:
({
    doInit : function(component, event, helper) {        
    },
    checkNewData: function(component, event, helper) {
        console.log('**test**'+component.get("v.recordId"));
        var actionAPI = component.find("quickActionAPI");
        var fields = {Id: {value: component.get("v.recordId")}};
        var args = { actionName : "Account.Edit", 
                     entityName : "Account",
                     targetFields : fields };
        console.log('**args**'+args);
        console.log('**args1**',args.toString());
        actionAPI.setActionFieldValues(args).then(function() {
            actionAPI.invokeAction(args);
        }).catch(function(e){
            if(e.errors){
                console.log('Action Field Log Errors are ',e.errors);
                console.error('Full error is ', JSON.stringify(e));
            }        
        });
    }
})

Please let me know If am doing anything wrong. 

Looking for suggestion. 

Thank you in Advance.
Hi All,

I am trying to call Account action Lets say Edit from Lightning component. I have used qucik Action API but always its gives me error:
"The action you specified isn’t available on the current record page". I Edit button is on page layout as well.

My code is below:
Component:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" extends="c:base">
    <aura:attribute name="acc" type="Account"/>
    <aura:attribute name="recordId" type="String"/>
    
    <force:recordData aura:id="recordLoader"
                      recordId="{!v.recordId}"
                      fields="Id, Name"                
                      targetFields="{!v.acc}"
                      targetError="{!v.recordLoadError}"
                      />
    
    
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    
     <lightning:quickActionAPI aura:id="quickActionAPI" />    
        <div class="slds-page-header">
            <lightning:buttonGroup>
                <lightning:button variant="neutral" label="Check for New Data" onclick="{!c.checkNewData}"/>        
            </lightning:buttonGroup>
        </div>    
</aura:component>

Controller:
({
    doInit : function(component, event, helper) {        
    },
    checkNewData: function(component, event, helper) {
        console.log('**test**'+component.get("v.recordId"));
        var actionAPI = component.find("quickActionAPI");
        var fields = {Id: {value: component.get("v.recordId")}};
        var args = { actionName : "Account.Edit", 
                     entityName : "Account",
                     targetFields : fields };
        console.log('**args**'+args);
        console.log('**args1**',args.toString());
        actionAPI.setActionFieldValues(args).then(function() {
            actionAPI.invokeAction(args);
        }).catch(function(e){
            if(e.errors){
                console.log('Action Field Log Errors are ',e.errors);
                console.error('Full error is ', JSON.stringify(e));
            }        
        });
    }
})

Please let me know If am doing anything wrong. 

Looking for suggestion. 

Thank you in Advance.
I'm doing the simple lightning components challenge and have hit this problem in my existing trailhead org and a brand new dev org that I've just created:

Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: QVWBQHAG