0

Hello guys I have the next situation... as the title says I have an action button that calls an Aura Component that calls a Flow. this flow receives recordId input and I search its correspondent record. Once I have this record and its recordId I call an Apex Action where I pass this recordId.

Everything works up to a point... the problem is that when I do the testing I as a user the action button opens correctly the flow and show me some screens I want from the flow, then when it the apex action comes I get the typical error when the flow fails: enter image description here

So I went to my debug log and got the followed error:

An Apex error occurred: System.StringException: Invalid id: 

Note that the Id is not show because directly it does not show.

My flow looks like this: enter image description here

My apex action looks like this: enter image description here

And my Apex class:

global class QX_Documento_Helper {
@InvocableMethod(label = 'Enviar notificacion')
public static List<String> sendNotificacion

List item

(List dataWrapper){ System.debug('data del flow -- ' + dataWrapper); DataWrapper datosDeFlow = dataWrapper[0]; String recordIdDocumento = dataWrapper[0].recordId; ...... } global class DataWrapper { @InvocableVariable global Id recordId; }

}

And my Aura Component only has this: the cmp file:

<aura:component implements="flexipage:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,force:hasRecordId,forceCommunity:availableForAllPageTypes,lightning:availableForFlowScreens,force:hasRecordId">
<aura:html tag="style">
    .slds-modal__container {
         width : 90% !important;
         max-width : 90% !important;
     }
</aura:html> 
<aura:attribute name="recordId" type="Id" />
<aura:handler name="init" value="{!this}" action="{!c.init}"/>
<lightning:flow aura:id = 'myFlow'/>
</aura:component>

And the aura controller js:

({
init : function(component, event, helper) {
    var flow = component.find("myFlow");
    var recordId = component.get("v.recordId");
    var inputVariables = [{name: 'recordId', type: 'Id', value: recordId}]

    flow.startFlow('FlowName',inputVariables)
}
})

The problem is that the recordId is not being informed when it is inside the Aura. Am I missing something in the Aura? What is happening? Could anybody help me?

1

1 Answer 1

1

Like Ben said, the type should be Id instead of String

Id recordIdDocumento = (Id)dataWrapper[0].recordId;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .