cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MikeRogers
Frequent Visitor

Error creating new Opportunity in Dynamics

I have a form that I am using to generate an new Account and Opportunity in Dynamics CRM. I create the new Account just fine but I am getting a 400 'Bad Request - Error in query syntax' message. I don't know what is causing it.

 

Here is my flow:

 

 

Any thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
MikeRogers
Frequent Visitor

Re: Error creating new Opportunity in Dynamics

I solved it. Turns out that Potential Customer type is a GUID rather than a name. Once that was set, everything worked as planned,

View solution in original post

8 REPLIES 8
Community Support
Community Support

Re: Error creating new Opportunity in Dynamics

Hi MikeRogers,

 

Do you mean that you are able to create the new account successfully though the flow throws an error “Bad request”?

 

It seems that there is a condition in your flow, how is it configured?

 

When using a Condition in a flow, you should add actions inside If yes or If now branch according to your needs. About how to add a condition in your flow, please check this doc for a reference:
https://docs.microsoft.com/en-us/flow/add-condition

 

Flows also fail if a setting in an action of the flow doesn't function as expected. In this case, the error message contains Bad request or Not found, or an error code of 400 or 404 appears. Please click or tap the Edit button and then correct the problem inside the flow definition. Please take this documentation for a reference:
https://docs.microsoft.com/en-us/flow/fix-flow-failures


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MikeRogers
Frequent Visitor

Re: Error creating new Opportunity in Dynamics

Mabel,

 

Thank you for the reply and no. What I meant was that I could successfully create a new account but the unhelpful error came when I tried to create a new Opportunity. 

MikeRogers
Frequent Visitor

Re: Error creating new Opportunity in Dynamics

I have created another flow with just a New Opportunity but it gives me the same error:

 

 Untitled1.png

 

I have double-checked the currency ID, the name and everything, but cannot find what would be giving me a 'Bad Request - Error in query syntax.'

MikeRogers
Frequent Visitor

Re: Error creating new Opportunity in Dynamics

I solved it. Turns out that Potential Customer type is a GUID rather than a name. Once that was set, everything worked as planned,

View solution in original post

Mynerj
New Member

Re: Error creating new Opportunity in Dynamics

Hi mike, i'm looking into the same thing as in the post and wondered if you could assist. How did you go about retreiving the GUID for the name of the contact/account.

MikeRogers
Frequent Visitor

Re: Error creating new Opportunity in Dynamics

Mynerj,

 

I retrieve the GUID by using another search query and retrieving the value from that. 

https://powerusers.microsoft.com/t5/media/gallerypage/image-id/22035i1C016111EF08DA76

Mynerj
New Member

Re: Error creating new Opportunity in Dynamics

Works perfectly thanks Mike.

OskarSvensson
New Member

Re: Error creating new Opportunity in Dynamics

Hi MikeRogers,

 

I've created a similar flow by using Microsoft Excel as the trigger. However, I'm trying to create a Business Opportunity in Dynamics with the information in Excel. But can't make it to work. I've posted a link to my flow below.

 

https://imgur.com/C56NbsC

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (5,937)