You need to sign in to do that
Don't have an account?
Abby Stocker
Related Records in Flow
I am a beginner here. I have started to self teach myself Apex and have received great help from this community so I figured I would try again. Here is the request: I have a custom "Claim" object. When an order is selected, a flow takes the user through adding order line items that are related to the selected order. Now I am starting a project for a new type of "Claim" and they want to take this a step further. From the claim record, users should get a flow to take them through the following: Be able to select MULTIPLE orders and then loop through each specific order line for each selected order and relate those to the claim as well. Please let me know if this makes absolutely zero sense. Thank you!!!!!
Component:
<aura:component implements="lightning:availableForFlowScreens" access="global">
<aura:attribute name="CurrentOrderLines" type="Order_Line__c[]" access="global" />
<aura:attribute name="columns" type="List" />
<aura:attribute name="selectedOrderLines" type="Order_Line__c[]" />
<aura:handler name="init" value="{!this}" action="{!c.init}" />
<lightning:datatable data="{!v.CurrentOrderLines}"
columns="{!v.columns}"
keyField="Id"
onrowaction="{!c.viewOrderLines}"
onrowselection="{!c.updateSelectedOrderLines}"/>
</aura:component>
Controller:
({
init : function(component, event, helper) {
var actions = [{label: 'Show details', name: 'show_details'}];
component.set('v.columns',[
{label: 'Order Line', fieldName: 'Name', type:'text'},
{label: 'Description', fieldName: 'Description__c', type:'text'},
{type: 'action', typeAttributes:{rowActions: actions}}
]);
},
viewOrderLines : function(component, event, helper) {
var action = event.getParam('action');
var row = event.getParam('row');
window.open('/'+row.Id,'_blank');
},
updateSelectedOrderLines : function(component,event,helper){
var selectedRows = event.getParam('selectedRows');
component.set('v.selectedOrderLines',selectedRows);
}
})
Design:
<design:component>
<design:attribute name="CurrentOrderLines" label="Existing Order Line List"/>
<design:attribute name="selectedOrderLines" label="Selected Order Lines"/>
</design:component>