+ Start a Discussion
Eclipse DeveloperEclipse Developer 

Clone Opportunity and related list using Flow

I'm trying to deep clone opportunity with a related list(custom object = trade lane),  Opportunity was cloned but related not cloned.

Flow Details
Flow API Name: OpportunityCloneFlow
Type: Screen Flow
Version: 10
Status: Active
Org: SF Desk (Private) Limited. (00D2v000001WLHR)
Flow Interview Details
Interview Label: OpportunityCloneFlow 6/17/2019 8:57 AM
Current User: Muhammad Jawwad (0052v00000Z1hCB)
Start time: 6/17/2019 8:57 AM
Duration: 0 seconds
How the Interview Started
Muhammad Jawwad (0052v00000Z1hCB) started the flow interview.
Some of this flow's variables were set when the interview started.
OpportunityCollection = [Opportunity (0062v00001DCMxhAAH)]
LOOP: OpportunityLoop
Loop Through: [0062v00001DCMxhAAH]
Iteration: 0
Current value of {!OpportunityCollectionVariable}: 0062v00001DCMxhAAH
GET RECORDS: OpportunityClone
Find one Opportunity record where:
Id Equals {!OpportunityCollectionVariable.Id} (0062v00001DCMxhAAH)
Successfully found record.
{!AccountId} = 0012v00002MYNkhAAH
{!CloseDate} = May 26, 2017
{!OpportunityId} = 0062v00001DCMxhAAH
{!OpportunityName} = Burlington Textiles Weaving Plant Generator
{!StageName} = Closed Won
CREATE RECORDS: CloneOpportunity
Create one Opportunity record where:
AccountId = {!AccountId} (0012v00002MYNkhAAH)
CloseDate = {!CloseDate} (May 26, 2017)
Name = {!OpportunityName} (Burlington Textiles Weaving Plant Generator)
StageName = {!StageName} (Closed Won)
A record is ready to be created when the next screen, pause, or local action is executed or when the interview finishes.
FAST LOOKUP: TradeLaneCollection
Find all Trade_Lane__c records where:
Opportunity__c Equals {!OpportunityId} (0062v00001DCMxhAAH)
Store those records in {!TradeLaneRecords}.
Save these field values in the variable: Name, Opportunity__c
Successfully found records.
LOOP: TradeLaneLoop
Loop Through: [a002v000043gglkAAA]
Iteration: 0
Current value of {!TradeLaneRecordsVariable}: a002v000043gglkAAA
Create one Trade_Lane__c record where:
Opportunity__c = {!NewOpportunityId} (null)
Failed to create record.
Error Occurred: This error occurred when the flow tried to create records: REQUIRED_FIELD_MISSING: Required fields are missing: [Opportunity__c]. You can look up ExceptionCode values in the SOAP API Developer Guide.
'Please help me