Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

Win/Lose Opportunity Through Odata API

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.

  • Suggested answer
    JAngle Profile Picture
    JAngle 33,155 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.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans