I have created a Flow which allows my users to insert multiple Currency_Detail__c
records from one page.
The Currency Detail records have a Master-Detail relationship with Opportunities. I have created a variable in the Flow OppId
which, as the name suggests, will store the Id of the Opportunity which each Currency Detail record needs to be related to.
I now need to add a custom button to the Currency Detail related records list, to launch the Flow and to populate the OppId
variable, with the Id of the Opportunity which the user is viewing.
I've created this VisualForce page
<apex:page standardController="Currency_Detail__c" recordSetVar="Currency_Details">
<flow:interview name="Create_Currency_Detail_Records" finishLocation="/{!Id}"/>
<apex:param name="OppId" value="{!Id}"/>
</apex:page>
But when I use this, it causes an error
(REQUIRED_FIELD_MISSING) Required fields are missing: [Opportunity__c] --- for SFDC record with ID : null
so it looks like the variable's not being populated.
This is probably completely off the mark but I can't save the page if I change value="{!Id}"
to value="{!Opportunity.Id}"
Unknown property 'Currency_Detail__cStandardController.Opportunity'
How can I populate the Flow's OppId
variable from the VisualForce page?
UPDATE
Just to make sure that the setup of my Flow's not the cause of the issue, this is how the Record Create elements are configured
The other two fields are taking their values from screen input fields on a screen element earlier in the Flow.
The OppId
variable is set to Input & Output.