Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Win/Lose Opportunity Through Odata API

(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.

  • Suggested answer
    JAngle Profile Picture
    JAngle 46 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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans