Skip to main content
Business Central forum
Answered

Win/Lose Opportunity Through Odata API

editSubscribe (0) ShareShare
ReportReport
Posted on by 5

Hi,

I use business central cloud and I've exposed a few opportunity pages through the web service page so I can access the data through api and it works for the most part. My issue is when I want to close the opportunity, there's not really a way to do it. I've tried manually changing the status code but it says it's read only. I tried changing the values that I could, like "OptionWon" and "Close_Opportunity_Code" (these are from the Close Opportunity page) and those updated the percent correctly and it sets the entry to won but it still doesn't set the status of the opportunity to won.

I've seen some posts on here talking about LoseOpportunity and WinOpportunity entities but those look like they're On Prem only.

Any help would be appreciated.

Thanks.

  • Heem Othman Profile Picture
    Heem Othman 5 on at
    RE: Win/Lose Opportunity Through Odata API

    Yeah, that makes sense. I'll have to give it a shot.

    Thanks.

  • Verified answer
    JAngle Profile Picture
    JAngle 33,131 on at
    RE: Win/Lose Opportunity Through Odata API

    I think a purpose built unbound action is needed with a codeunit. Pass it the opportunity number and result. It goes on to  update the opportunity. Probably by repurposing the code which does this in the first place. I think a lot of it lives on a page.

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Sundar…

Industry experts answer burning questions directly from our amazing Community…

Enabling Copilot Case and Conversation…

Agents can easily recap an ongoing chat, transcribe a voice conversation…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,030 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,562 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans