You need to sign in to do that
Don't have an account?
Andries.Neyens
Calling a Quick Action from a custmo Lightning Component
I'm trying to launch a custom quick action from within a Lightning Component.
According the example given, it should work:
https://developer.salesforce.com/docs/atlas.en-us.case_feed_dev.meta/case_feed_dev/quickaction_api_getCustomAction.htm
And it all does work, if I add the highlight panel on the page that include the Quick action.
If you remove it from the page, the api returns:
According the example given, it should work:
https://developer.salesforce.com/docs/atlas.en-us.case_feed_dev.meta/case_feed_dev/quickaction_api_getCustomAction.htm
And it all does work, if I add the highlight panel on the page that include the Quick action.
If you remove it from the page, the api returns:
{"targetName":"Contact","actionName":"Contact.Call","success":false,"parentContext":null}Is there a way to call them, without having them on the lightning page?
You can call custom action from quickaction api. Create quick action in contact named UpdateContact and try below code.
Component Code
Controller Code
Thanks,
Yogesh
did you tried this component on a lightning page ? It will work if you already have that action somewhere defined (like in a highlight component) on the page. But try it without that and you will receive:
"The action you specified isn’t available on the current record page."
You can only use the Quick Action API on a lightning record page. You also have to include the quick action on the page layout (mobile & lightning experience actions section) for it to be available for use. It's a pretty limited feature at the moment but has a lot of potential. The documentation is also pretty vague, at best, but if you have any questions let me know since I've got it working on my Account page.
Hi @SamHowle,
I am also getting the same error while trying to access the aviailable action fields for send Email action, Could you please tell me what's wrong in my code? Thanks.
Component Code:
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" description="My Lightning Component">
<lightning:quickActionAPI aura:id="quickActionAPI" />
<aura:attribute name="recordId" type="Id" />
<div>
<lightning:button label="Test Send Email" onclick="{!c.sendEmail}"/>
<!--<lightning:button label="Update Case Status Field" onclick="{!c.updateCaseStatusAction}"/>-->
</div>
</aura:component>
Controller Code:
({
sendEmail : function(component, event, helper) {
alert('Hello');
var actionAPI = component.find("quickActionAPI");
var recordId = component.get("v.recordId");
var args = {actionName :"Account.SendEmail", entityName: "Account"};
actionAPI.getAvailableActionFields(args).then(function(result){
console.log('Available Fields are ', JSON.stringify(result));
}).catch(function(e){
if(e.errors){
console.log('Action Field Log Errors are ',e.errors);
console.error('Full error is ', JSON.stringify(e));
}
});
}
})