web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Create an opportunity automatically from lead and close opportunity

(1) ShareShare
ReportReport
Posted on by 190

Hello,

I want to create a workflow that when a lead has a specific lead source, it will automatically qualify the lead and create an opportunity.

Then, when the opportunity is created and contains a specific referral source, it will automatically close as won.

From my understanding, you would need two separate workflows for each specific action. Lets say the lead source I want to use is called Web Lead. I tried creating a workflow called "When lead source equals Web Lead ----> perform action QualifyLead.

However, this is causing an error. It says I need to give a specific lead ID - but this will be using the same lead ID every time then which makes no sense.

On the opportunity level - I tried the same workflow with referral source instead of lead source - and then CloseOpportunity as Won. This time, it won't work because it wants me to insert a specific close date, when I want it to just be the date it is actually closing on.

Any help would be greatly appreciated. Thank you.

I have the same question (0)
  • dynamicsgs Profile Picture
    190 on at
    RE: Create an opportunity automatically from lead and close opportunity

    Hi Paul,

    After changing this it is still appearing as an invalid argument.

  • Paul_Owen Profile Picture
    2,027 on at
    RE: Create an opportunity automatically from lead and close opportunity

    No problem, I think it's because you are setting the Actual Revenue to itself which doesn't get completed until the opportunity gets closed based on the Estimated Revenue, so set that field with the Estimated Revenue value.

    Regards

    Paul

  • dynamicsgs Profile Picture
    190 on at
    RE: Create an opportunity automatically from lead and close opportunity

    Hi Paul,

    Sorry to come back again. For auto-closing the opportunity - it is failing because of an "invalid argument."

    Do you know what could be causing this? I have attached what we have done for the workflow.Annotation-2020_2D00_04_2D00_01-120332.jpg

  • Paul_Owen Profile Picture
    2,027 on at
    RE: Create an opportunity automatically from lead and close opportunity

    No problem, glad you got it sorted.

    Regards

    Paul

  • dynamicsgs Profile Picture
    190 on at
    RE: Create an opportunity automatically from lead and close opportunity

    Thank you Paul for your time on this.

    Went back in and checked everything, double checked everything and then saw the issue. For some reason we have 2 qualified options on our dropdown, so I flipped it to the other qualified option and it works.

    This is fantastic to see these leads flow into our system and automatically qualify. What I need to do next to set up a process where these Opps that are created from the process you helped with automatically qualify as won so i end up in a situation where items come in as leads and, qualify, win and revenue booked all without a touch from a sales person.

    Thanks again for your time on this, if there is anything i can do to help you back please just let me know.

  • Verified answer
    Paul_Owen Profile Picture
    2,027 on at
    RE: Create an opportunity automatically from lead and close opportunity

    I can replicate your error by selecting the Status as New, but as qualified it works for me. Try changing to another status and run it then change it back to Qualified and see if that resolves it, I might just be stuck somehow, maybe even delete it and start again?

    pastedimage1585314315224v1.png

    Regards

    Paul

  • dynamicsgs Profile Picture
    190 on at
    RE: Create an opportunity automatically from lead and close opportunity

    Ok, so i did the same, I create a new lead, lead source as our trigger and changed the status reason to qualified and it failed for the same error on my side.

    I cant change the status from open to qualified unless the lead is saved first. What we are trying to do is automatically qualify a lead that comes from a particular source.

    Perhaps our thinking is wrong and there is a different way to get this done in your mind which I would be happy to hear.

  • dynamicsgs Profile Picture
    190 on at
    RE: Create an opportunity automatically from lead and close opportunity

    Hi Paul,

    Thanks for showing this. Can I ask on the suceeded one you show did that qualify the lead and create an opportunity.

    I have a succeded one showing now too but it hasnt qualifed the lead or created and opp. i think it successfully ran because the lead was created but the lead source was not "Web - ChargeBee" as this is our trigger.

    I then went ahead and created a new lead in our system, upon creating it I added the lead source of "Web - ChargeBee"

    Lead is created but the process errors with the state code being the error.

    pastedimage1585312871812v1.pngpastedimage1585312891113v2.png

    Wondering what is the error that is causing the state code to be wrong or the status code is invalid?

    Is it possible for the system to do what we are asking it to do in your opinion. And thanks for the time on this, much appreciated.

  • Verified answer
    Paul_Owen Profile Picture
    2,027 on at
    RE: Create an opportunity automatically from lead and close opportunity

    That happened when I tested as I had the status as New but when I changed it to qualified it worked correctly.

    Regards

    Paul

  • dynamicsgs Profile Picture
    190 on at
    RE: Create an opportunity automatically from lead and close opportunity

    This is the error that is appearing now

    MicrosoftTeams_2D00_image-_2800_4_2900_.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 167

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 116 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans