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
Connie SintosConnie Sintos 

Stuck on Module 2 Trailhead - Create a flow to streamline entry of new accounts, contacts, and opportunities.

Please help!  I am stuck on creating flows.  Can't seem to work.  I keep on re-doing my work and not sure if I am doing it right.  The challlenge as follows:

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.The Flow will need to be called 'New Customer Flow'.
The Flow should have a screen with fields for First Name, Last Name, Company Name, Opportunity Amount, and Opportunity Stage.
The Flow needs to have steps to create an account, a contact, and an opportunity from the data entered.
Opportunity name, close date and stage are required fields. Name the Opportunity '{Company Name} - {Last Name}', set the close date to one month from today and set the stage to 'Prospecting'.
The Flow should be invoked from a Visualforce page.
The Visualforce page should be called FlowPage.
The Visualforce page will need a component to reference the 'New Customer Flow' process.

If possible, if you can provide a snapshot.

Thank you.
Best Answer chosen by Connie Sintos
sandeep sankhlasandeep sankhla
Hi Connie,

Please refer the below screenshot..I have implemented the same and it is run perfect..

User-added image
2.User-added image

3.User-added image
4.
User-added imageUser-added image

Please check with these screenshot and let me know if it works for you...
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.

Thanks,
Sandeep
Salesforce Certified Developer 
 

All Answers

sandeep sankhlasandeep sankhla
Hi Connie,

Please refer the below screenshot..I have implemented the same and it is run perfect..

User-added image
2.User-added image

3.User-added image
4.
User-added imageUser-added image

Please check with these screenshot and let me know if it works for you...
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.

Thanks,
Sandeep
Salesforce Certified Developer 
 
This was selected as the best answer
Connie SintosConnie Sintos
Hello Sandeep,

I slightly edited what I had to look at what you have provided (great snapshot, btw!).  Now, I got an error: Challenge not yet complete... here's what's wrong: A Visualforce page named 'FlowPage' was not found.

This is for the last 3 bullets in the challenge:
1)The Flow should be invoked from a Visualforce page.
2)The Visualforce page should be called FlowPage.
3)The Visualforce page will need a component to reference the 'New Customer Flow' process.

I tried to do the steps from the module, but I don't understand.  Can you please help again?

Thanks.
Connie Sintos
Satya Krishna Ravipati 6Satya Krishna Ravipati 6
Create a VF Page Named FlowPage with the following content. This should solve your visual force problem::

<apex:page >
       <flow:interview name="New_Customer_Flow">
       </flow:interview>
</apex:page>
Ros ForceRos Force
I keep getting the same error.

Encountered unhandled fault when running process New_Customer_Flow/30190000000PWE0 exception by user/organization: 00D900000010GY8/{4}

UPSERT --- UPSERT FAILED ---  ERRORS :  (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] ---  for SFDC record with ID : null,

caused by element : FlowRecordCreate.Create_Opportunity

caused by: UPSERT --- UPSERT FAILED ---  ERRORS :  (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] ---  for SFDC record with ID : null,

Salesforce Error ID: 1551753124-13136 (-1680723869)

:( Not sure what I'm doing incorrectly.
Ros ForceRos Force
Never mind, I figured it out :)
arvind bhandari 8arvind bhandari 8
HI Ros, 
We are getting the same error which you have faced please provide the solution as you figured it out.

UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] --- for SFDC record with ID : null,
Amit Khanduri.Amit Khanduri.
Hi Ros Force, am also getting the same error please suggest me the solution ??
Liz Kao - ActiveLiz Kao - Active
But Sandeep's screenshots don't have the contact or Opportunity linked to the created Account (via a lookup, if done manually). How does one create a new Contact record, and associate it with the Account just created the step before? Same goes for the Opportunity.
Elisabeth KooijmansElisabeth Kooijmans
I made the same remark as Liz, but when you check the challenge it says "challenge complete". Oh well...
John LinJohn Lin
I get this error message when I use this code in VF page:

[Error] Error: FlowPage line 2, column 27: Open quote is expected for attribute "name" associated with an element type "flow:interview"
[Error] Error: Open quote is expected for attribute "name" associated with an element type "flow:interview".

<apex:page>
   <flow:interview name = “New_Customer_Flow” />
</apex:page>

Please help.
Catherine Moore (Heller)Catherine Moore (Heller)
Hi John, I got that same error, and just removed the quotes and added them back in using the keyboard and it was fine - something wasn't recognizing the quotes I'd copied and pasted from elsewhere.
CNishantCNishant

@ros - How did you figured it out?

I am not able to put prospecting in stored value.

Abdul BabaAbdul Baba
Hi guys, I am working on this challenge in Trailhead and seem to be stuck also. I have implemented the process based on the screesshots shared here but when I run it, I get this error message: "An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information." Any ideas on how to solve this will be greatly appreciated. Thanks!
   
Clair LamClair Lam

If you have this error:
UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] --- for SFDC record with ID : null,
Refer to this article: https://help.salesforce.com/apex/HTViewSolution?id=000044625&language=en_US

You must go to stored values (from your screen) and type in the choice with no brackets and just text. This worked for me.

KCBKCB

ANWER FOR following message

UPSERT --- UPSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [StageName] --- for SFDC record with ID : null,
the error is telling you that, you didn't provided value to Opportunity StageName and Account field in opportunity. Make sure you have this setup while Create Opportunity selection

How to provide relations among (Account and Contact ) or (account and Opportunity)
1) While creating account, bottom of the edit page you will see "Assign the record ID to a variable ...."
2) in Field variable, select option CREATE NEW. 
3) select VARIABLE option - give a name to vairable like "CreatedAccountID" and Select default option to "ID" ( what you are trying to do?, untill this step you are capturing the account id for the new record which created and assinging it to a variable called "CreatedAccountID")

4) Now when you are creating a new record for Contact ot Opportunity, In Assignments select account ID  and assigng value "CreatedAccountID" . This way you are trying to provide relation to your parrent record. 
Ros ForceRos Force
Hi guys! Sorry I didn't see your questions earlier. Everything answered OK for you now?
Rajneesh Ranjan 23Rajneesh Ranjan 23
While creating Opportunity record, the requirement is to concatenate two strings - Name the Opportunity '{Company Name} - {Last Name}'.
Although Salesforce trailhead automated script doesn't validate "Opportunity Name" and you will clear the challenge even you don't include this Last Name.

But this can be achieved using below formula:
- Create a formula from Resources tab
- Give a unique Name and then use below code to concatenate these two fields
  {!Company_Name} + '-' + {!Last_Name}
-
Now use this formula on the Opportunity create window under assignments section --> Formulas --> select Formula Name that you have created in above step.
Niño Wilbert SesgundoNiño Wilbert Sesgundo
Thanks for the screenshot sandeep sankhla!
Pathma JemmyPathma Jemmy
I am also getting this error. 

"An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information."

The screen shots where very useful. created the screen and three records resp for Accounts, Contact and Opportunity.
In the Visual Force Page entered the

First Name
Last Name
Company Name
Opportunity Amount
Opportunity Stage(Dropdown list value "Prospecting")

Thanks,


       
Colm DoranColm Doran
Hi All,

I was stuck on this exercise for ages but then found this Thread and the screenshots were just perfect. I was able to complete the exercise and pass the Check. Thank you for sharing this info.

Regards,
Colm
Colleen OliverColleen Oliver
Trying to create the variable ID and KCB says to select default option to ID but I don't have ID as a choice in the default option.  Help?
Colleen OliverColleen Oliver
Sandeep - I copied your screen shots exactly and I am getting the following error: An error occurred at element Create_Account (FlowRecordCreate).
INSERT --- INSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [Name],

Help?
INDERJEET S SINGERKHANIINDERJEET S SINGERKHANI

Hello Everyone,
Thanks to @Rajneesh Ranjan 23 to help me in solving the syntax error in the Opportunity name from Screen Input Data.

Here what i did to pass this challenge
1. Adding screen on the canvas 
User-added image

2. Add Name, Unique name
User-added image

3. Select Add a Field Tab, Add Textbox to Rightside for First Name, Last Name and Company Name.
User-added image

4. Add Currency for Opportunity Amount.
User-added image

5. Add Dropdown List for Opportunity Stage
User-added image

Conti.......!
 

INDERJEET S SINGERKHANIINDERJEET S SINGERKHANI
6. Add Label and Unique name for all above and leave the default other setting
User-added image

7. For Opportunity Stage Dropdown List select Picklist Choice
User-added image
And Set PICKLIST CHOICE as
User-added image

8. Now add Record Create element from Palette on Canvas for creating Account, Contact and Opportunity
User-added image

9. Double click first record element and fill as follow
User-added image
Continue.....!
INDERJEET S SINGERKHANIINDERJEET S SINGERKHANI
10. Double click second Record Create element and fill as follow for Contact
User-added image

11. Double click third Record Create element and fill as follow for opportunity
Add screen input for Amount
And for Close Date and Opportunity Name
Select formula for CloseDate and Opportunity Name. You can create Formula by selecting CREATE NEW-->formula
User-added image

For CloseDate formula
User-added image
For Opportunity Name Formula
User-added image
This is all for Flow Setting
Now invoking this to Visualforce Page.
​Continue.......! 
INDERJEET S SINGERKHANIINDERJEET S SINGERKHANI
For Visualforce Setting
Go to Setting search Visualforce Page in Quickfind box,
Select New
User-added image

For adding to Visualforce Component
Search Visualforce Component in Quickfind box

On Visualforce Component, Create New

User-added image

Use same code for both Visualforce Page & Component

<apex:component >
  <flow:interview name="New_Customer_Flow" />
</apex:component>



REGARDS,
Theodore RayTheodore Ray
I've having a problem with this challenge. when I save it I get a warning:

Activation Warnings (1) All issues must be fixed before you can activate this flow.
ClosingDate (formula): The formula expression is invalid: Formula result is data type (Date), incompatible with expected data type (Text).

I don't understand why the system is expecting the Text data type for this standard date field. Has anyone come accross a similar issue?

Many thanks!!

Theodore
Naveen Kumar 317Naveen Kumar 317
Thanks INDERJEET
Theodore RayTheodore Ray
screen of the fault message

This is the message I get. 
Theodore RayTheodore Ray
So apparently the date field on the opportunity record create is incorrect but why should the system expect it to be a text field when the field type is date? 

Here's what I've set up:

User-added image
I've done the closing date as a date formula fieldd with the formulation as above (current datee+30) as shown in slide 11 of the post of 26th April 2016.

Please let me know if you need more screens or info?

Many thanks!

Theodore
Theodore RayTheodore Ray
Thanks! I've posted screens on the blog!
Brad RosenBrad Rosen
Thank you INDERJEET! Walked through your process and worked perfectly.
Jason FungJason Fung
Thanks INDERJEET! Because of you I passed the challenge on Trailhead but still can't wrap my mind around the logics. I guess I will have to study up more on this later. 
Vinay KolusuVinay Kolusu
Thanks Inderjeet, i was stuck with the formula, your posts had helpme 
ArchestainArchestain
Thanks Inderjeet :)
 
sanigdha bhutanisanigdha bhutani
Thanks Inderjeet
Seth OvermireSeth Overmire
Thanks a whole lot! Was stuck on this one for a while.
Emily Walton 10Emily Walton 10
So I passed the module, but when I try to run the flow it still says An unhandled fault has occurred in this flow...so it didn't really help me learn how to really build a flow correctly. 
Rick KutcherRick Kutcher

I still can't get the date formula to work. I do the Flow current date + 30, but I get an error about expected format of text.

Also, I was driving myself crazy about this: It seems that 3 distinct records are created - Account, Contact, and Opportunity. I kept thinking they should be related, and have cross connections (the Account would have the contact, and the contact would have the account listed, and the opportunity would be listed in the Account). Is that possible, or does it come up in a later module?

Lisa McDonough 2Lisa McDonough 2
Hi,

I am also getting this message when I try to run the flow - "An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information." 
When I checked my email this is the error -  
An error occurred at element Opportunity (FlowRecordCreate).
INSERT --- INSERT FAILED --- ERRORS : (REQUIRED_FIELD_MISSING) Required fields are missing: [Discount_Percenet__c]

I followed the screen shots exactly (thank for those), so I'm not sure what this means.  Any ideas?

Thanks
Maarten MeijerMaarten Meijer
Also from my side: Thanks INDERJEET. I got stuck on the FlowPage and Component. At the end retyped your text instead of copy/paste and it worked.
Heidi KingHeidi King
Thank you INDERJEET! I completed the task successfully with your wonderful screen prints, and I ran the flow in Developer, and everything worked great. However, it doesn't appear that my contact and opportunity are linked to the account. Was this something I did wrong? 
 
Sally VilardiSally Vilardi
I keep getting this error - I have completed the project 3 times - I don't know how to get another NEW - DE of Salesforce? 

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: TCBPLASJ
Akshay KopardeAkshay Koparde
Hi,
I found good video for completing this challenge.
In the Opportunity Object
1. The Opportunity Name should be dynamic. So we need choose formula
        {!OpportrunityName}+"-"+{!LastName}
2. Opportunity Close date also should be dynamic. So we need to select formula
       {!Flow.CloseDate}+30
Please check the below link for detailed procedure
https://www.youtube.com/watch?v=Rm0oFxhWuO4
 
Amanda Baskind 12Amanda Baskind 12
I also want to Thank You Inderjeet!

I am getting the same problem as you Heidi King. I passed the challenge, but to effectively make this flow work in the real world it would be nice to know how the three records can link within a flow. Does anybody know how to do this?
Riyaz LakhaniRiyaz Lakhani
Hi i get the error msg that challange not completed ..i need help..
I have added the New customer flow in default Page Layout ..then too its showing an error
veeranji kunveeranji kun
@Riyaz,

From Setup, enter Lightning App Builder in the Quick Find box, then select Lightning App Builder.--> click on "New" --> It will open lighting ui --> Select "Home Page"  --> Click "Next" --> Give label name "Demo home" --> click on "Finish" --> Drag and drop vf component --> Click on "save" -->click on "Activate" --> Select "Set this page as Default Home page" --> click "Next" and Activate .

 
wittenrawittenra
Hi @Riyaz, thanks for your description, but i am still stock on the error, that the challenge can not find the flow on my home page, eventhough, i made it exactly as per your description. Any other idea?
Riyaz LakhaniRiyaz Lakhani
Hi @wittenra 

Please follow these steps:

1. Go to Lightning App Builder from Setup

2. Check if there are multiple Home Page Lightning pages. If Yes, then delete the other ones.

3. After deleting the others, make sure the only Home Pag has the flow you created for the trailhead challenge.

Hope this wil solve ur problem...
wittenrawittenra
@Riyaz, thx, that has solved my issue, i had few home pages. Thanks!