Skip to main content

Notifications

Announcements

No record found.

Business Central forum

When Declaring function with return Value in event , it Showing error.!

Posted on by 245

8030.Capture.PNG

When I am Declaring return Value in Procedure it's showing an Error "The event 'GetLastShipmentNo' must not have a return value.".  Can any one Suggest me What is Wrong with code.

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: When Declaring function with return Value in event , it Showing error.!

    Exit returns a value. You cannot use it with Exit(xxx). Your event subscriber function must not return any values.

  • Manikanta_501 Profile Picture
    Manikanta_501 245 on at
    RE: When Declaring function with return Value in event , it Showing error.!

    Capture_5F00_1.PNG

    #Stefano Demiliani

    If I remove the return Value , it's Showing another error : "Since 'GetLastShipmentNo' doesn't have a return value, EXIT cannot be called with a value" at Exit() function.

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: When Declaring function with return Value in event , it Showing error.!

    This is an event subscriber, you cannot have a return value. In the event subscriber you write code that is executed attached to the standard event.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans