• Jen Bryant
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hi,
I have written a lightning component and calling a flow from this. It works fine except there is one problem. I am able to pass the record id as a flow variable since that is the flow input variable but there is one more field inside the flow and the flow has a decision node based on that field. If i pass only the Id, the other field inside the flow doenst seem to get the field value even though the field from the same object.
If this is the case how can i pass other field value to the flow along with the id ?
Below are my component and controller: 
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
    <aura:attribute name="claim" type="Claim__c"/>
    <aura:attribute name="claimId" type="Id"/>
    <force:recordData aura:id="claimRecordLoader" recordId="{!v.recordId}" fields="Submit_to_TPA__c"
                      targetRecord="{!v.claim}" />
    <aura:handler name="init" value="{!this}" action="{!c.init}" />
    <lightning:flow aura:id="flowData"/>
</aura:component>
 
({
    init : function (component) {
        // Find the component whose aura:id is "flowData"
        var flow = component.find("flowData");
        var inputVariables = [
            {
                name : "ClaimIdVar",
                type : "SObject",
                value : { "Id" : component.get("v.recordId")}
                //value : component.get("v.recordId")
            }
        ];
        // In that component, start your flow. Reference the flow's Unique Name.
        flow.startFlow("SubmitToTPA", inputVariables );
    },
    
})



 

I have a simple flow as follows:

 

1. Screen 1: Create a contact record Yes or No

2. Decision Yes or No

3. If i choose No, I go to the finish screen right away.

4.  If Yes, I go to screen 2 when i enter the contact name, address etc

5. Then i save my contact record 

6. Go back to step 1 which will ask me if i want to create a contact or not....

 

Q1: Here I have the same issue as mentionned in Here where the Yes is selected by default. Is there a way to bypass it?

 

Q2: I call my flow from a VF tab from the page as follows:

 

<apex:page sidebar="false" tabStyle="Contact" cache="false">
<flow:interview name="Ouverture_du_dossier_Client" finishLocation="{!URLFOR('/home/home.jsp')}"/>
</apex:page>

When I run the flow from the VF page, and the second time I reach step 4, my contact form retains all the previous values i had entered and this is a pain. Please also note that I disabled caching in my browser. Has anyone encountered this data caching issue when revisiting flow screens? 

 

Thanks in advance,

Siim

 

 

 

 

 

  • January 10, 2013
  • Like
  • 0