function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
arvind bhandari 8arvind bhandari 8 

Create a flow to streamline entry of new accounts, contacts, and opportunities. UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] --- for SFDC record with ID : null,

Trailhead chhalendge:
Create a flow to streamline entry of new accounts, contacts, and opportunities.

UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] --- for SFDC record with ID : null,
vj rajvj raj
Hi All....
The Trick to complete the challenge is, first check the required fields in Account, Contact and Opportunity Objects.
Required Fields::
Account Object : Account Name
Contact Object : Last Name
Opportunity Object : Opportunity Name, Close Date, Stage and Amount

The fields we are taking from the user inputs are First Name, Last Name, Company Name, Opportunity Amount and Stage.
So in the canvas we need 
1. Screen - Collecting data from the user (First Name, Last Name, Company Name, Opportunity Amount and Stage)
     in this set Company Name  as Required and Stage in Dropdown List
User-added image

2. Record Create for Account
User-added image

3. Record Create for Contact

User-added image

4. Record Create for Opportunity 

User-added image

1)The Flow should be invoked from a Visualforce page.
Setup ==> Build ==> Develop ==> Pages ==> New

User-added image

2)The Visualforce page should be called FlowPage.
Label Name = FlowPage and save it.

3)The Visualforce page will need a component to reference the 'New Customer Flow' process.
Setup ==> Build ==> Create ==> Tabs ==> Visualforce Tabs ==> New

Hope This helps all.
Elisabeth KooijmansElisabeth Kooijmans
The problem with this flow is that there is no connection between the created account and the created contact and the created opportunity. On top of that tthe opportunity name is the same as the account name. The flow runs but is not doing what I though it was supposed to do.
Ashish Tondare SFDCAshish Tondare SFDC
Yes, Even I confused with this. I thought it would link Account - > Contact and Account -> Opportunity. Let me know if you figure out something.
Andrew RobertsAndrew Roberts
Hi - I managed to get the different objects to link together in this challenge by creating a variable in the Account creation box. I lnked the variable to the record create.  Then in the subsequent contact create and opportunity create stages, I added a row in each which linked the account id standard field to the variable I created in the account create box.  When the flow then creates the contact record, it links it to my new account, and then links the newly created opportunity to the account as well.  Is this what you were after?  A
Andrew, you shared somethign I would like to understand better.  Any chance you could provide some screenshots or a more sdetailed explanation of how you linked the contact and opportunity to the account?
Andrew RobertsAndrew Roberts
Hi Roy

In the Accounts Record create box, I added the variable capture as shown here.

User-added image

Then in the opportunity Record create, I assigned that variable to the Account ID.

User-added image

User-added image

Hello Everyone ..
This is the solution For above question.
1. For Account
AccountName = 'Company Name '

2. For Contact 
LastName  = 'Last Name' Form Screen input Variable

3. For Opportunity 
Name = ' Company Name' 
Stage = ' Prospecting'  I created screen input variable stage with default value ' Prospecting'.
CloseDate  = ' Select Next Month Date From Today'.
Amount = ' $2000' i creted screen input variable with deafult value ' $2000'.
At the last call you flow in visualforce page with " <flow:interview name="New_Customer_Flow"/>".
I hope this example will solve your issue.
Arun PrakashArun Prakash
Hi Andrew
Could You please share the Screen shots of your variable creation tab for your variable named(acc_IDENT2)
Jihane MessoudiJihane Messoudi
Hi, I respect the same steps of this process but I still have this error message :
Challenge Not yet complete... here's what's wrong: 
The 'FlowPage' Visualforce page does not have a flow:interview component.

Someone could help me please?
Hi,below my flow, maybe can help you.

1.I checked each object has the required fields
2.I created a new flow with the following fields (Text fields:First Name (required),Last Name,Company Name,Currency field: Opportunity Amount (required), Choice:Opportunity Stage (prospecting is a picklist field))

User-added image

3.I created three record 

User-added image

User-added image
User-added image

4.I added the connector and save as New Custom Flow.Then I tried to run and I verified  there weren't errors
User-added image
5.I created the visualforce page and then the related visualforce tab

I am stuck in this for some reason . Please help.visualforce page
And it the flowpage status is draft. How Do I make it active? sdf
Alex J BorycaAlex J Boryca
Hi Sanjay,

Your visualforce page is showing an error because it is trying to reference a Flow with the name "New_Customer_Flow" - then in your second screenshot, you show that your flow is incorrectly named "FlowPage."  I suggest opening your flow and clicking "Save As" - Selecting the option "New Flow" and naming it "New Customer Flow"

See below:
User-added image
Tom HyattTom Hyatt
Has anyone been able to get this to work correctly?  I tried the above and it still doesn't link the Contact record with the account record.  Any help would be appreciated.  
I hope this be usefull for you (each image has two screenshots).

Global view and Insert screen
  • Global view
  • Opportunity Stage uses a Picklist (below). Last Name and Company Name are mandatory because they are necessary to create the Account, the Contact and the Opportunity (both of them), Stage uses a Picklist

Picklist for Opportunity Stage and Account creation
  • Picklist, referencing StageName from Opportunity
  • Account creation (storing the generated ID)
Contact Creation and Opportunity creation
  • Contact creation, using the Account ID previously stored (I also keep the Contact ID, but it's not necessary)
  • Opportunity creation. Using the AccountID too, a formula for the date and another formula for the name

Opportunity name formula and Date formula
  • The name of the Opportunity is a concatenation of Company Name and Last Name
  • The formula for the date is not quite accurate, it only adds 30 days to the current date, I recomend you to see this:
Visualforce Page and result
  • Visualforce definition
  • Result
Hi I just took the challege and works fine with following Flow Design:

Question: To pass this challenge you will need to create a flow that implements the business process of Account, Contact, and Opportunity data entry and place it on a Visualforce page.

1) Flow Design looks as below:
Please note we use 2 Assignment Elements

New Customer Flow

2) Use Screen Element to Capture Data:
Screen Element with fields for First Name (Text), Last Name(Text), Company Name (Text), Opportunity Amount (Number), and Opportunity Stage(Choice with at least 2 values)

3) Create Account:
Create an Account with Record Create Element, Capture created Account's  ID  to be later used to Associate with Contact & Opportunity

4) Create Contact
Create an Contact with Record Create Element, Capture created Contacts ID  if you wish to use it in future flow elements (not necessary)

4) Create Variable "TodaysDate"  to capture todays date {!$Flow.CurrentDate}
Please Note : You cant create formulas using dates or set values so this is the way out (use a variable and then use assignment element to increment date)

5) Create Variable "OpportunityNameStartsWith_CompanyName"  to Initially hold first part of the opportunity name to be "Company_Name"

6) Use Assignment Element to assign a future date to "TodaysDate"  that is 30 or 31 days ahead

By use of Assignment Element you change the variable through the flow life cycle.

7) Use Assignment Element to Concatinate "Last name" of contact to variable "OpportunityNameStartsWith_CompanyName" as we need to have OpportunityName ----------- "{Company Name} - {Last Name}'"

User-added image

8) Create Opportunity
Use Record Create Element to create the opportunity

User-added image
9) Create a simple VF Page called "FlowPage"
<apex:page > <flow:interview name="New_Customer_Flow" /> </apex:page>

10) Create a VF Tab to call the page
Veena GopalVeena Gopal
since closedate is a date type field, the assignment variable does not come in the choice. how to add itthe assignment variable choice does not come for close date.
Rahul BhallaRahul Bhalla
Just manually choose the date from calendar icon 1 month from now.
Sheetal HajareSheetal Hajare
I found below video, which helped me to get clarity and complete challenge. It connects all objects as well. Very simple. 
hina manzurhina manzur
I followed the same steps in the video but I have no idea why i get below error. did anyone has similar issue like mine?
User-added image