Closed ezrafischer closed 5 years ago
Hi,
you need to create a custom event and triggered it using the following:
Event:
<aura:event type="APPLICATION" description="CustomEventName">
</aura:event>
Row Button, e.g.: Event: e.c:CustomEventName Payload:
{
"objectId":"#Id#",
"parentObjectId":"#parentrecordId#",
"otherStuff":"otherAttribute"
}
Custom Component placed anywhere on the page:
<aura:component description="Custom_Actions"
implements="flexipage:availableForRecordHome,flexipage:availableForAllPageTypes,force:hasRecordId"
access="global">
<aura:handler event="c:CustomEventName" action="{!c.handleApplicationEvent}"/>
</aura:component>
JS Controller:
({
handleApplicationEvent: function (cmp, event) {
var parentObjectId = event.getParam("parentObjectId");
var objectId = event.getParam("objectId");
var otherStuff = event.getParam("otherStuff");
//DO STH. HERE, e.g. record form with the 2 fields you need to change and pop it open in a modal.
}
})
hth matthias
Wow -- thank you!!
I followed this and I am receiving an error:
Error: Invalid event name - cannot identify event
Hi,
I'm looking for more documentation on creating custom actions in the EnhancedLightningGrid. I'm specifically trying to create a row button on an Order Line Item that lets a user edit just the quantity field on that OrderItem.
Thanks, Ezra